From 98bc135baf2bae90f39bb919f56afce5ae13a1ad Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 24 Nov 2008 23:03:27 +0000 Subject: * interp/lisplib.boot (compDefineExports): Tidy. * interp/define.boot (compDefineFunctor1): Adjust call. --- src/ChangeLog | 5 +++++ src/interp/define.boot | 2 +- src/interp/lisplib.boot | 27 +++++++++++++++------------ 3 files changed, 21 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 92225468..e8aef8cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-11-24 Gabriel Dos Reis + + * interp/lisplib.boot (compDefineExports): Tidy. + * interp/define.boot (compDefineFunctor1): Adjust call. + 2008-11-23 Gabriel Dos Reis * interp/i-output.boot ($RecordSeparator): New. diff --git a/src/interp/define.boot b/src/interp/define.boot index bfcfa996..fe88c86e 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -590,7 +590,7 @@ compDefineFunctor1(df is ['DEF,form,signature,$functorSpecialCases,body], $e:= giveFormalParametersValues(argl,$e) [ds,.,$e]:= compMakeCategoryObject(target,$e) or return stackAndThrow('" cannot produce category object: %1pb",[target]) - $compileExportsOnly => compDefineExports($op, ds.1, signature',$e) + $compileExportsOnly => compDefineExports(form, ds.1, signature',$e) $domainShell:= COPY_-SEQ ds --+ copy needed since slot1 is reset; compMake.. can return a cached vector attributeList := disallowNilAttribute ds.2 --see below under "loadTimeAlist" diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index fe0972da..79b4ec24 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -705,24 +705,27 @@ getIndexTable dir == nil) --% -compDefineExports(op,ops,sig,e) == +compDefineExports(form,ops,sig,e) == not $LISPLIB => systemErrorHere "compDefineExports" + op := first form -- Ensure constructor parameters appear as formals sig := SUBLIS($pairlis, sig) ops := SUBLIS($pairlis,ops) - -- Since we don't compile the capsule, the slot numbers are + form := SUBLIS($pairlis,form) + -- In case we are not compiling the capsule, the slot numbers are -- most likely bogus. Nullify them so people don't think they -- bear any meaningful semantics (well, they should not think -- these are forwarding either). - for entry in ops repeat - fixupSigloc entry where - fixupSigloc entry == - [opsig,pred,funsel] := entry - if pred ^= 'T then - rplac(second entry, simpBool pred) - funsel is [op,a,:.] and op in '(ELT CONST) => - rplac(third entry,[op,a,nil]) - ops := listSort(function GGREATERP, ops, function first) + if $compileExportsOnly then + for entry in ops repeat + fixupSigloc entry where + fixupSigloc entry == + [opsig,pred,funsel] := entry + if pred ^= 'T then + rplac(second entry, simpBool pred) + funsel is [op,a,:.] and op in '(ELT CONST) => + rplac(third entry,[op,a,nil]) + ops := listSort(function GGREATERP, ops, function first) libName := getConstructorAbbreviation op exportsFile := strconc(STRING libName,'".sig") removeFile exportsFile @@ -730,7 +733,7 @@ compDefineExports(op,ops,sig,e) == PRETTYPRINT( ["SETQ", "$CategoryFrame", ["put", quoteForm op, quoteForm "isFunctor", quoteForm ops, - ["addModemap", quoteForm op, quoteForm first sig, + ["addModemap", quoteForm op, quoteForm form, quoteForm sig, true, quoteForm op, ["put", quoteForm op, quoteForm "mode", quoteForm ["Mapping",:sig], "$CategoryFrame"]]]], s)) -- cgit v1.2.3