temp var puzzle

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

temp var puzzle

Bany, Michel
Hi Avi,

While backporting some code from VW to Squeak, I found strange that
something that works fine in VW, does not work in Squeak :

renderContentOn: html
        | temp |
        html form:
                [html textInputWithCallback:
                        [:v | temp := v].
                html submitButtonWithAction:
                        [self inform: 'Hello ', temp]].

In VW, the value of "temp", computed by the first callback, is available
to the second callback. In Squeak, the value is not available, the only
solution I found was to make "temp" an i-var.

The same difference can be observed with the canvas api.

Do you think anything could be done to have Seaside behave in Squeak
like
in VW.

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

Re: temp var puzzle

Cees De Groot
On 2/6/06, Bany, Michel <[hidden email]> wrote:
> Do you think anything could be done to have Seaside behave in Squeak
> like in VW.
>
As soon as Squeak has real closures integrated (3.9 should have the
closure compiler), that stuff should work. I think Seaside sends
#fixTemps here and there to blocks under Squeak (or something similar
is going on, related to blocks not being closures in Squeak)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: temp var puzzle

Marcus Denker

On 06.02.2006, at 13:29, Cees De Groot wrote:

> On 2/6/06, Bany, Michel <[hidden email]> wrote:
>> Do you think anything could be done to have Seaside behave in Squeak
>> like in VW.
>>
> As soon as Squeak has real closures integrated (3.9 should have the
> closure compiler)

Not really... 3.9 will have the closure runtime, the compiler will be  
a loadable
module for those that need it.

(switching a compiler is something that takes some care.. and there  
are some
smaller and larger glitches that need to be sorted out).

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

Re: temp var puzzle

Cees De Groot
On 2/6/06, Marcus Denker <[hidden email]> wrote:
> Not really... 3.9 will have the closure runtime, the compiler will be
> a loadable module for those that need it.
>
Good enough :)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: temp var puzzle

Adrian Lienhard
In reply to this post by Bany, Michel
Hi Michel,

Using a state holder stored in the temp should work too. Like that  
you would not need an i-var.

Adrian


On Feb 6, 2006, at 13:16 , Bany, Michel wrote:

> Hi Avi,
>
> While backporting some code from VW to Squeak, I found strange that
> something that works fine in VW, does not work in Squeak :
>
> renderContentOn: html
> | temp |
> html form:
> [html textInputWithCallback:
> [:v | temp := v].
> html submitButtonWithAction:
> [self inform: 'Hello ', temp]].
>
> In VW, the value of "temp", computed by the first callback, is  
> available
> to the second callback. In Squeak, the value is not available, the  
> only
> solution I found was to make "temp" an i-var.
>
> The same difference can be observed with the canvas api.
>
> Do you think anything could be done to have Seaside behave in Squeak
> like
> in VW.
>
> Michel.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

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

RE: temp var puzzle

Bany, Michel
In reply to this post by Bany, Michel
> Using a state holder stored in the temp should work too. Like
> that you would not need an i-var.
>
> Adrian
>

Hi Adrian,
Actually any object will do, like a ValueHolder, a collection,
even a Customer or whatever, but with this hack the code may
get somewhat bizarre.
Still, the real issue is portability from VW to Squeak :-(

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

Re: temp var puzzle

Adrian Lienhard

On Feb 6, 2006, at 15:01 , Bany, Michel wrote:

>> Using a state holder stored in the temp should work too. Like
>> that you would not need an i-var.
>>
>> Adrian
>>
>
> Hi Adrian,
> Actually any object will do, like a ValueHolder, a collection,

yes sure, I meant value holder.

> even a Customer or whatever, but with this hack the code may
> get somewhat bizarre.

indeed - but maybe still better than using an instance variable...

> Still, the real issue is portability from VW to Squeak :-(

yes, it would be nice to get these kind of things fixed in Squeak.

Adrian

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

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