Cascading TagBrush

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

Cascading TagBrush

laci
Hi guys,
The latest version of at:put: doesn't allow cascading TagBrush messages.

aHTMLCanvas div id: 'test'; class: 'modal hide fade'; at: 'aria-hidden' put: true.
returns true instead of aTagBrush.

The implementation changed from:
at: aString put: aValue
    <self['@element'].setAttribute(aString, aValue)>

to:
at: aString put: aValue
        <self['@element'].setAttribute(aString, aValue); return aValue>

Is there any reason for that?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Cascading TagBrush

Herby Vojčík


laci wrote:
> Hi guys,
> The latest version of at:put: doesn't allow cascading TagBrush messages.
>
> aHTMLCanvas div id: 'test'; class: 'modal hide fade'; at: 'aria-hidden' put:
> true.
> returns true instead of aTagBrush.

Well, what you just did _is_ cascading. So cascading works perfectly fine - cascade returns the return value of last message.

If you want to return the receiver from the cascade, add 'yourself' message at the end of cascade.

BTW, Amber coding conventions on the wiki say you always should include 'yourself'.

> The implementation changed from:
> at: aString put: aValue
>      <self['@element'].setAttribute(aString, aValue)>
>
> to:
> at: aString put: aValue
> <self['@element'].setAttribute(aString, aValue); return aValue>
>
> Is there any reason for that?

Yes. All decent and nice at:put: methods return the object that is being put. TagBrush >> at:put: was incorrect and was fixed.

> Thanks

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

RE: Cascading TagBrush

laci
Thanks Herby. A code running on prior amber version broke. I'll fix my code as you suggested.

From: Herby Vojčík [via Smalltalk]
Sent: 30/12/2013 18:00
To: laci
Subject: Re: Cascading TagBrush



laci wrote:
> Hi guys,
> The latest version of at:put: doesn't allow cascading TagBrush messages.
>
> aHTMLCanvas div id: 'test'; class: 'modal hide fade'; at: 'aria-hidden' put:
> true.
> returns true instead of aTagBrush.

Well, what you just did _is_ cascading. So cascading works perfectly fine - cascade returns the return value of last message.

If you want to return the receiver from the cascade, add 'yourself' message at the end of cascade.

BTW, Amber coding conventions on the wiki say you always should include 'yourself'.

> The implementation changed from:
> at: aString put: aValue
>      <self['@element'].setAttribute(aString, aValue)>
>
> to:
> at: aString put: aValue
> <self['@element'].setAttribute(aString, aValue); return aValue>
>
> Is there any reason for that?

Yes. All decent and nice at:put: methods return the object that is being put. TagBrush >> at:put: was incorrect and was fixed.

> Thanks

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Cascading-TagBrush-tp4733117p4733118.html
To start a new topic under Amber Smalltalk, email [hidden email]
To unsubscribe from Amber Smalltalk, click here.
NAML