[VW] Porting 2.6a2 - WAHtmlAttributes

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

[VW] Porting 2.6a2 - WAHtmlAttributes

Bany, Michel
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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [VW] Porting 2.6a2 - WAHtmlAttributes

Marco Qualizza

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

[hidden email]

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



-- 

Marco Qualizza - (613) 895-2078

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


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [VW] Porting 2.6a2 - WAHtmlAttributes

Avi  Bryant

On Jan 21, 2006, at 7:14 AM, Marco Qualizza wrote:
>    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...)
Yes, but what's strange is the (implicit) assumption that the  
#attributes dictionary is going to return an association rather than  
just the value.  This definitely needs to be fixed.  The reason it  
hasn't been yet is just that I've been hesitant to break code that  
(like the example Michel posted) relies on it being wrong.  I guess  
we should just suck it up and break it now.

BTW, Michel, I've been a bit busy and haven't been properly tracking  
the changes you've been making to support the VW port.  If you send  
me an email summarizing them I'll work to integrate them into the  
mainline (or will it be obvious enough if I just read through the  
commit logs?)

Avi
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [VW] Porting 2.6a2

Michel Bany-3
Avi Bryant a écrit :

>
> BTW, Michel, I've been a bit busy and haven't been properly tracking  
> the changes you've been making to support the VW port.  If you send  
> me an email summarizing them I'll work to integrate them into the  
> mainline (or will it be obvious enough if I just read through the  
> commit logs?)
>
Avi,

I have been working on the next VW port starting from Seaside2.6a2-avi.78
and using a baby-steps approach, i.e. with only one change in each new
version.
I believe it will be obvious for you to cherry pick (as you said before)
those changes
that make sense to you (and discard those you do not like).

At the moment, I do have a working port of  Seaside2.6a2-mb.105, but I
need to
verify that it integrates properly with SeasideAsync and I want to try
it with a real
Seaside application. When I'm satisfied, I will push the port to the
Store repository.

Michel.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside