Smalltalk syntax...? (cascading method calls)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Smalltalk syntax...? (cascading method calls)

Joachim Jaeckel
Hello,

I have a question regarding what's the difference between both method
calls in the example below, because I thought, both are equivalent, but
in the later one, I get a parse error:

/home/joe/.st/UrPics.star#VFS.ZipFile/PageTemplate.st:47: parse error,
expected ']'

Would be nice, if someone could point me to my error in thinking...
(or my mistake in understanding the smalltalk syntax)

This works:

(e anchor href: 'http://smalltalk.gnu.org')
     image source: '/resources/gst_medium.png' alternativeText: 'abc'.

and this one throws the parse error:


e anchor href: 'http://smalltalk.gnu.org';
     image source: '/resources/gst_medium.png' alternativeText: 'abc'.

Thanks in advance,
Joachim.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntax...? (cascading method calls)

Paolo Bonzini-3

> (e anchor href: 'http://smalltalk.gnu.org')
>     image source: '/resources/gst_medium.png' alternativeText: 'abc'.
>
> and this one throws the parse error:
>
> e anchor href: 'http://smalltalk.gnu.org';
>     image source: '/resources/gst_medium.png' alternativeText: 'abc'.

This one would work:

(e anchor
     href: 'http://smalltalk.gnu.org';
     image) source: '/resources/gst_medium.png' alternativeText: 'abc'.

Basically you cannot chain unary messages after a semicolon.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Smalltalk syntax...? (cascading method calls)

Joachim Jaeckel
> (e anchor
>     href: 'http://smalltalk.gnu.org';
>     image) source: '/resources/gst_medium.png' alternativeText: 'abc'.
>
> Basically you cannot chain unary messages after a semicolon.

Ok, thank you Paolo!

(I wonder, how man traps are waiting for me... ;-)

Best regards,
Joachim.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk