From 4e59a0f4d0ce881f79ae146fce1f85467755bb99 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 4 May 2012 13:41:44 +0000 Subject: * interp/clam.boot ($hashNode): Remove. (compHashGlobal): Likewise. --- src/ChangeLog | 5 +++++ src/interp/clam.boot | 51 +-------------------------------------------------- 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c5e44456..068a1ac1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-05-04 Gabriel Dos Reis + + * interp/clam.boot ($hashNode): Remove. + (compHashGlobal): Likewise. + 2012-05-04 Gabriel Dos Reis * interp/clam.boot (compHash): Avoid unnecessary gensyms. diff --git a/src/interp/clam.boot b/src/interp/clam.boot index c551f415..e5d2f4ec 100644 --- a/src/interp/clam.boot +++ b/src/interp/clam.boot @@ -67,14 +67,9 @@ namespace BOOT -- are cleared -- see definition of backendCompile2 in c-util which calls clamComp below -++ -$hashNode := [[]] - ++ $failed := '"failed" --- see SETQ LISP for initial def of $hashNode - compClam(op,argl,body,$clamList) == --similar to reportFunctionCompilation in SLAM BOOT if $InteractiveMode then startTimingProcess 'compilation @@ -165,11 +160,7 @@ compClam(op,argl,body,$clamList) == op compHash(op,argl,body,cacheNameOrNil,eqEtc,countFl) == - --Note: when cacheNameOrNil~=nil, it names a global hashtable - --- cacheNameOrNil => compHashGlobal(op,argl,body,cacheNameOrNil,eqEtc,countFl) --- This branch to compHashGlobal is now omitted; as a result, --- entries will be stored on the global hashtable in a uniform way: +-- Entries will be stored on the global hashtable in a uniform way: -- (, ,:) -- where the reference count is optional @@ -269,46 +260,6 @@ compHash(op,argl,body,cacheNameOrNil,eqEtc,countFl) == LAM_,EVALANDFILEACTQ cacheResetCode op -compHashGlobal(op,argl,body,cacheName,eqEtc,countFl) == - --Note: when cacheNameOrNil~=nil, it names a global hashtable - - if (not (eqEtc in '(UEQUAL))) then - sayBrightly "for hash option, only EQ, CVEC, and UEQUAL are allowed" - auxfn:= makeSymbol strconc(op,'";") - g1:= gensym() --argument or argument list - [arg,cacheArgKey,computeValue] := - -- arg: to be used as formal argument of lambda construction; - -- cacheArgKey: the form used to look up the value in the cache - -- computeValue: the form used to compute the value from arg - application:= - argl = nil => [auxfn] - argl is [.] => [auxfn,g1] --g1 is a parameter - ['APPLY,['function,auxfn],g1] --g1 is a parameter list - [g1,['consForHashLookup,MKQ op,g1],application] - g2 := gensym() --value computed by calling function - returnFoundValue:= - countFl => ['CDRwithIncrement,g2] - g2 - getCode:= ['tableValue,cacheName,cacheArgKey] - secondPredPair:= [g2,returnFoundValue] - putForm:= ['%pair,MKQ op,g1] - putCode:= - countFl => - ['%store,['tableValue,cacheName,putForm],['%pair,1,computeValue]] - ['%store,['tableValue,cacheName,putForm],computeValue] - thirdPredPair := ['%otherwise,putCode] - codeBody := ['%bind,[[g2,getCode]],['%when,secondPredPair,thirdPredPair]] - mainFunction:= [op,['LAMBDA,arg,codeBody]] - computeFunction:= [auxfn,['LAMBDA,argl,:body]] - compileInteractive mainFunction - compileInteractive computeFunction - op - -consForHashLookup(a,b) == - $hashNode.first := a - $hashNode.rest := b - $hashNode - CDRwithIncrement x == x.first := first x + 1 rest x -- cgit v1.2.3