# HG changeset patch # User Claus Gittinger # Date 895239210 -7200 # Node ID 408ac886ffc1240fbc6fae6075e00fdf13ecac33 # Parent 09f35b01bbcf5322e06e730c41ce7842e48f09a5 allow 0-args in #receiver:selector:args:fold: diff -r 09f35b01bbcf -r 408ac886ffc1 MessageNd.st --- a/MessageNd.st Thu May 14 20:53:18 1998 +0200 +++ b/MessageNd.st Fri May 15 15:33:30 1998 +0200 @@ -217,50 +217,52 @@ |numArgs arg1 arg1Val| folding notNil ifTrue:[ - numArgs := argArray size. - arg1 := (argArray at:1). - (numArgs == 1) ifTrue:[ - ^ self receiver:recNode selector:selectorString arg:arg1 fold:folding - ]. + numArgs := argArray size. + numArgs > 0 ifTrue:[ + arg1 := (argArray at:1). + (numArgs == 1) ifTrue:[ + ^ self receiver:recNode selector:selectorString arg:arg1 fold:folding + ]. - "/ - "/ #perform:... with a constant selector - "/ - numArgs <= 6 ifTrue:[ - (#(nil - #'perform:with:' - #'perform:with:with:' - #'perform:with:with:with:' - #'perform:with:with:with:with:' - #'perform:with:with:with:with:with:' - #'perform:with:with:with:with:with:with:' - ) at:numArgs) = selectorString - ifTrue:[ - arg1 isConstant ifTrue:[ - arg1Val := arg1 evaluate. - arg1Val isSymbol ifTrue:[ - ^ MessageNode - receiver:recNode - selector:arg1Val - args:(argArray copyFrom:2) - fold:folding - ] - ] - ] - ]. + "/ + "/ #perform:... with a constant selector + "/ + numArgs <= 6 ifTrue:[ + (#(nil + #'perform:with:' + #'perform:with:with:' + #'perform:with:with:with:' + #'perform:with:with:with:with:' + #'perform:with:with:with:with:with:' + #'perform:with:with:with:with:with:with:' + ) at:numArgs) = selectorString + ifTrue:[ + arg1 isConstant ifTrue:[ + arg1Val := arg1 evaluate. + arg1Val isSymbol ifTrue:[ + ^ MessageNode + receiver:recNode + selector:arg1Val + args:(argArray copyFrom:2) + fold:folding + ] + ] + ] + ]. + ]. - (numArgs == 2) ifTrue:[ - ^ self receiver:recNode selector:selectorString arg1:arg1 arg2:(argArray at:2) fold:folding - ]. - numArgs > Method maxNumberOfArguments ifTrue:[ - ^ 'too many arguments for current VM implementation'. - ]. + (numArgs == 2) ifTrue:[ + ^ self receiver:recNode selector:selectorString arg1:arg1 arg2:(argArray at:2) fold:folding + ]. + numArgs > Method maxNumberOfArguments ifTrue:[ + ^ 'too many arguments for current VM implementation'. + ]. ]. ^ (self basicNew) receiver:recNode selector:selectorString args:argArray lineno:0 "Modified: / 3.9.1995 / 16:41:39 / claus" - "Modified: / 15.1.1998 / 15:20:00 / cg" + "Modified: / 15.5.1998 / 15:32:05 / cg" ! ! !MessageNode methodsFor:'accessing'! @@ -2299,5 +2301,5 @@ !MessageNode class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.85 1998-04-02 17:09:26 cg Exp $' + ^ '$Header: /cvs/stx/stx/libcomp/Attic/MessageNd.st,v 1.86 1998-05-15 13:33:30 cg Exp $' ! ! diff -r 09f35b01bbcf -r 408ac886ffc1 MessageNode.st --- a/MessageNode.st Thu May 14 20:53:18 1998 +0200 +++ b/MessageNode.st Fri May 15 15:33:30 1998 +0200 @@ -217,50 +217,52 @@ |numArgs arg1 arg1Val| folding notNil ifTrue:[ - numArgs := argArray size. - arg1 := (argArray at:1). - (numArgs == 1) ifTrue:[ - ^ self receiver:recNode selector:selectorString arg:arg1 fold:folding - ]. + numArgs := argArray size. + numArgs > 0 ifTrue:[ + arg1 := (argArray at:1). + (numArgs == 1) ifTrue:[ + ^ self receiver:recNode selector:selectorString arg:arg1 fold:folding + ]. - "/ - "/ #perform:... with a constant selector - "/ - numArgs <= 6 ifTrue:[ - (#(nil - #'perform:with:' - #'perform:with:with:' - #'perform:with:with:with:' - #'perform:with:with:with:with:' - #'perform:with:with:with:with:with:' - #'perform:with:with:with:with:with:with:' - ) at:numArgs) = selectorString - ifTrue:[ - arg1 isConstant ifTrue:[ - arg1Val := arg1 evaluate. - arg1Val isSymbol ifTrue:[ - ^ MessageNode - receiver:recNode - selector:arg1Val - args:(argArray copyFrom:2) - fold:folding - ] - ] - ] - ]. + "/ + "/ #perform:... with a constant selector + "/ + numArgs <= 6 ifTrue:[ + (#(nil + #'perform:with:' + #'perform:with:with:' + #'perform:with:with:with:' + #'perform:with:with:with:with:' + #'perform:with:with:with:with:with:' + #'perform:with:with:with:with:with:with:' + ) at:numArgs) = selectorString + ifTrue:[ + arg1 isConstant ifTrue:[ + arg1Val := arg1 evaluate. + arg1Val isSymbol ifTrue:[ + ^ MessageNode + receiver:recNode + selector:arg1Val + args:(argArray copyFrom:2) + fold:folding + ] + ] + ] + ]. + ]. - (numArgs == 2) ifTrue:[ - ^ self receiver:recNode selector:selectorString arg1:arg1 arg2:(argArray at:2) fold:folding - ]. - numArgs > Method maxNumberOfArguments ifTrue:[ - ^ 'too many arguments for current VM implementation'. - ]. + (numArgs == 2) ifTrue:[ + ^ self receiver:recNode selector:selectorString arg1:arg1 arg2:(argArray at:2) fold:folding + ]. + numArgs > Method maxNumberOfArguments ifTrue:[ + ^ 'too many arguments for current VM implementation'. + ]. ]. ^ (self basicNew) receiver:recNode selector:selectorString args:argArray lineno:0 "Modified: / 3.9.1995 / 16:41:39 / claus" - "Modified: / 15.1.1998 / 15:20:00 / cg" + "Modified: / 15.5.1998 / 15:32:05 / cg" ! ! !MessageNode methodsFor:'accessing'! @@ -2299,5 +2301,5 @@ !MessageNode class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.85 1998-04-02 17:09:26 cg Exp $' + ^ '$Header: /cvs/stx/stx/libcomp/MessageNode.st,v 1.86 1998-05-15 13:33:30 cg Exp $' ! !