aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/define.boot6
-rw-r--r--src/interp/format.boot2
-rw-r--r--src/interp/i-output.boot13
3 files changed, 16 insertions, 5 deletions
diff --git a/src/interp/define.boot b/src/interp/define.boot
index abc12e16..8204957c 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -2004,8 +2004,10 @@ spadCompileOrSetq(db,form is [nam,[lam,vl,body]]) ==
registerFunctionReplacement(nam,nam')
sayBrightly ['" ",:bright nam,'"is replaced by",:bright nam']
else if macform := expandableDefinition?(vl,body) then
- registerFunctionReplacement(nam,macform)
- sayBrightly ['" ",:bright nam,'"is replaced by",:bright body]
+ registerFunctionReplacement(nam,macform)
+ [:vl',.] := vl
+ sayBrightly ['" ",:bright prefix2String [nam,:vl'],
+ '"is replaced by",:bright prefix2String body]
form :=
getFunctionReplacement nam =>
diff --git a/src/interp/format.boot b/src/interp/format.boot
index 0d4f3d4b..41033b90 100644
--- a/src/interp/format.boot
+++ b/src/interp/format.boot
@@ -446,7 +446,7 @@ form2String1 u ==
argl := rest argl
(null argl) or null (first argl) => [lo, '".."]
[lo, '"..", form2String1 first argl]
- isBinaryInfix op => formatAsFortranExpression [op,:argl]
+ binaryInfix? op => formatAsFortranExpression [op,:argl]
application2String(op,[form2String1 x for x in argl], u1)
formWrapId id ==
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index af86f29e..d734fbc1 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -469,8 +469,17 @@ rbrkSch() == symbolName specialChar 'rbrk
lbrkSch() == symbolName specialChar 'lbrk
quadSch() == symbolName specialChar 'quad
-isBinaryInfix x ==
- member(x, '(_= _+ _- _* _/ _*_* _^ "=" "+" "-" "*" "/" "**" "^"))
+++ List of binary operators
+$BinaryOperators ==
+ ["**", "^", "*", "/", "//", "\", "\\", "rem", "quo", "exquo", "+", "-",
+ "/\", "\/", "=", "~=", "<", "<=", ">", ">=", "and", "or", ">>", "<<",
+ "by", "has", "case", "->", "..", "|"]
+
+
+binaryInfix? x ==
+ ident? x => symbolMember?(x,$BinaryOperators)
+ string? x => symbolMember?(makeSymbol x,$BinaryOperators)
+ false
stringApp([.,u],x,y,d) ==
appChar(strconc($DoubleQuote,atom2String u,$DoubleQuote),x,y,d)