--- a/MessageNd.st Sat Jun 28 15:32:28 1997 +0200
+++ b/MessageNd.st Sat Jun 28 15:36:23 1997 +0200
@@ -62,41 +62,43 @@
Notice: this method is normally disabled - its just a demo after all.
"
folding notNil ifTrue:[
- "/
- "/ do constant folding ...
- "/
- (recNode isConstant and:[argNode1 isConstant]) ifTrue:[
- "check if we can do it ..."
- selector := selectorString asSymbolIfInterned.
- selector notNil ifTrue:[
- recVal := recNode evaluate.
- (recVal respondsTo:selector) ifTrue:[
- "
- we could do much more here - but then, we need a dependency from
- the folded selectors method to the method we generate code for ...
- limit optimizations to those that will never change
- (or - if you change them - you will crash so bad ...)
- "
- argVal := argNode1 evaluate.
- ((recVal isMemberOf:Array) and:[argVal isMemberOf:Array]) ifTrue:[
- folding == #full ifTrue:[
- (selector == #with:collect:) ifTrue:[
- (argNode2 isMemberOf:BlockNode) ifTrue:[
- SignalSet anySignal handle:[:ex |
- ^ 'error in constant expression (' , ex errorString , ')'
- ] do:[
- result := recVal perform:selector with:argVal with:(argNode2 evaluate).
- ].
- ^ ConstantNode type:(ConstantNode typeOfConstant:result) value:result
- ]
- ]
- ]
- ]
- ]
- ]
- ]
+ "/
+ "/ do constant folding ...
+ "/
+ (recNode isConstant and:[argNode1 isConstant]) ifTrue:[
+ "check if we can do it ..."
+ selector := selectorString asSymbolIfInterned.
+ selector notNil ifTrue:[
+ recVal := recNode evaluate.
+ (recVal respondsTo:selector) ifTrue:[
+ "
+ we could do much more here - but then, we need a dependency from
+ the folded selectors method to the method we generate code for ...
+ limit optimizations to those that will never change
+ (or - if you change them - you will crash so bad ...)
+ "
+ argVal := argNode1 evaluate.
+ ((recVal isMemberOf:Array) and:[argVal isMemberOf:Array]) ifTrue:[
+ folding == #full ifTrue:[
+ (selector == #with:collect:) ifTrue:[
+ (argNode2 isBlock) ifTrue:[
+ SignalSet anySignal handle:[:ex |
+ ^ 'error in constant expression (' , ex errorString , ')'
+ ] do:[
+ result := recVal perform:selector with:argVal with:(argNode2 evaluate).
+ ].
+ ^ ConstantNode type:(ConstantNode typeOfConstant:result) value:result
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
].
^ (self basicNew) receiver:recNode selector:selectorString args:(Array with:argNode1 with:argNode2) lineno:0
+
+ "Modified: 28.6.1997 / 15:16:01 / cg"
!
receiver:recNode selector:selectorString arg:argNode
@@ -2120,5 +2122,5 @@
!MessageNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.75 1997-06-27 16:33:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.76 1997-06-28 13:36:23 cg Exp $'
! !
--- a/MessageNode.st Sat Jun 28 15:32:28 1997 +0200
+++ b/MessageNode.st Sat Jun 28 15:36:23 1997 +0200
@@ -62,41 +62,43 @@
Notice: this method is normally disabled - its just a demo after all.
"
folding notNil ifTrue:[
- "/
- "/ do constant folding ...
- "/
- (recNode isConstant and:[argNode1 isConstant]) ifTrue:[
- "check if we can do it ..."
- selector := selectorString asSymbolIfInterned.
- selector notNil ifTrue:[
- recVal := recNode evaluate.
- (recVal respondsTo:selector) ifTrue:[
- "
- we could do much more here - but then, we need a dependency from
- the folded selectors method to the method we generate code for ...
- limit optimizations to those that will never change
- (or - if you change them - you will crash so bad ...)
- "
- argVal := argNode1 evaluate.
- ((recVal isMemberOf:Array) and:[argVal isMemberOf:Array]) ifTrue:[
- folding == #full ifTrue:[
- (selector == #with:collect:) ifTrue:[
- (argNode2 isMemberOf:BlockNode) ifTrue:[
- SignalSet anySignal handle:[:ex |
- ^ 'error in constant expression (' , ex errorString , ')'
- ] do:[
- result := recVal perform:selector with:argVal with:(argNode2 evaluate).
- ].
- ^ ConstantNode type:(ConstantNode typeOfConstant:result) value:result
- ]
- ]
- ]
- ]
- ]
- ]
- ]
+ "/
+ "/ do constant folding ...
+ "/
+ (recNode isConstant and:[argNode1 isConstant]) ifTrue:[
+ "check if we can do it ..."
+ selector := selectorString asSymbolIfInterned.
+ selector notNil ifTrue:[
+ recVal := recNode evaluate.
+ (recVal respondsTo:selector) ifTrue:[
+ "
+ we could do much more here - but then, we need a dependency from
+ the folded selectors method to the method we generate code for ...
+ limit optimizations to those that will never change
+ (or - if you change them - you will crash so bad ...)
+ "
+ argVal := argNode1 evaluate.
+ ((recVal isMemberOf:Array) and:[argVal isMemberOf:Array]) ifTrue:[
+ folding == #full ifTrue:[
+ (selector == #with:collect:) ifTrue:[
+ (argNode2 isBlock) ifTrue:[
+ SignalSet anySignal handle:[:ex |
+ ^ 'error in constant expression (' , ex errorString , ')'
+ ] do:[
+ result := recVal perform:selector with:argVal with:(argNode2 evaluate).
+ ].
+ ^ ConstantNode type:(ConstantNode typeOfConstant:result) value:result
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
+ ]
].
^ (self basicNew) receiver:recNode selector:selectorString args:(Array with:argNode1 with:argNode2) lineno:0
+
+ "Modified: 28.6.1997 / 15:16:01 / cg"
!
receiver:recNode selector:selectorString arg:argNode
@@ -2120,5 +2122,5 @@
!MessageNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.75 1997-06-27 16:33:17 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.76 1997-06-28 13:36:23 cg Exp $'
! !