logo       

Re: [VW] Porting 2.6a2 - WAHtmlAttributes: msg#00196

lang.smalltalk.squeak.seaside

Subject: Re: [VW] Porting 2.6a2 - WAHtmlAttributes

Hello,


   I know it's been a week since you posted this, so your issue might be resolved...  But I think that the example you gave is faulty...


   id := (html attributes at: 'id' ifAbsent: [ 'id' -> 'default-id' ]) value


   is, at least according to the Dictionary API, exactly what you'd expect...  (#at:ifAbsent: evaluates the block and returns the result...)


   Things would be wonky (wrt Dictionary API) if:

   a> html attributes at: 'id' ifAbsent: [ 'id' -> 'default-id' ]

     in any way modified the attributes (the block doesn't modify the attributes)

   b> html attributes at: 'id' ifAbsentPut: [ 'default-id' ]

        returned an association.




Friday, January 13, 2006, 10:20:28 AM, you wrote:


> Hi Avi,


> I find the api of WAHtmlAttributes a bit strange.

> #at: answers the value while #at:ifAbsent: and #at:ifAbsentPut: answer

> an association


> This imposes strange, difficult-to-read and error prone (imho)

> constructs like:


>         id := (html attributes at: 'id' ifAbsent: ['id' ->

> 'default-id']) value.


> One would rather expect a behavior similar to Dictionary.


> Any chance to see this corrected ?


> Michel.






> _______________________________________________

> Seaside mailing list

> Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



-- 

Marco Qualizza - (613) 895-2078

"Elegance is not optional." (Richard O'Keefe)

_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise