diff options
author | dos-reis <gdr@axiomatics.org> | 2010-05-28 14:12:41 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-05-28 14:12:41 +0000 |
commit | 460eba8d1a5ea8feef28282e70ba2d22fa1fcdc6 (patch) | |
tree | ddd3aed51b69201221c396bf9e11465c8fb782bb /src/interp | |
parent | af089a02e32f424463e93e147b60222de0839f1e (diff) | |
download | open-axiom-460eba8d1a5ea8feef28282e70ba2d22fa1fcdc6.tar.gz |
Add support for 'property' builtin function.
* interp/g-timer.boot: Rename property to prop to avoid conflict.
* boot/parser.boot (bpAssignLHS): Allow functional places to
assign to.
* boot/ast.boot (bfPlace): New.
(bfAssign): Handle %Place forms.
* boot/tokens.boot: property is now translated to GET.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/g-timer.boot | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/interp/g-timer.boot b/src/interp/g-timer.boot index 91b48708..85bce196 100644 --- a/src/interp/g-timer.boot +++ b/src/interp/g-timer.boot @@ -44,10 +44,10 @@ namespace BOOT printTimeIfTrue := false $printStorageIfTrue := false -printNamedStatsByProperty(listofnames, property) == - total := +/[GETL(name,property) for [name,:.] in listofnames] +printNamedStatsByProperty(listofnames, prop) == + total := +/[GETL(name,prop) for [name,:.] in listofnames] for [name,:.] in listofnames repeat - n := GETL(name, property) + n := GETL(name, prop) strname := STRINGIMAGE name strval := STRINGIMAGE n sayBrightly concat(bright strname, @@ -57,15 +57,15 @@ printNamedStatsByProperty(listofnames, property) == fillerSpaces(65-# STRINGIMAGE total,'"."),bright STRINGIMAGE total) makeLongStatStringByProperty _ - (listofnames, listofclasses, property, classproperty, units, flag) == + (listofnames, listofclasses, prop, classprop, units, flag) == total := 0 str := '"" - otherStatTotal := GETL('other, property) + otherStatTotal := GETL('other, prop) for [name,class,:ab] in listofnames repeat name = 'other => 'iterate cl := first LASSOC(class,listofclasses) - n := GETL( name, property) - PUT(cl,classproperty, n + GETL(cl,classproperty)) + n := GETL( name, prop) + PUT(cl,classprop, n + GETL(cl,classprop)) total := total + n if n >= 0.01 then timestr := normalizeStatAndStringify n @@ -74,18 +74,18 @@ makeLongStatStringByProperty _ otherStatTotal := otherStatTotal + n str := makeStatString(str,timestr,ab,flag) otherStatTotal := otherStatTotal - PUT('other, property, otherStatTotal) + PUT('other, prop, otherStatTotal) if otherStatTotal > 0 then str := makeStatString(str,normalizeStatAndStringify otherStatTotal,'O,flag) total := total + otherStatTotal cl := first LASSOC('other,listofnames) cl := first LASSOC(cl,listofclasses) - PUT(cl,classproperty, otherStatTotal + GETL(cl,classproperty)) + PUT(cl,classprop, otherStatTotal + GETL(cl,classprop)) if flag ~= 'long then total := 0 str := '"" for [class,name,:ab] in listofclasses repeat - n := GETL(name, classproperty) + n := GETL(name, classprop) n = 0.0 => 'iterate total := total + n timestr := normalizeStatAndStringify n |