[Glass] Why this closure is not #isSimple ???
Mariano Martinez Peck via Glass
glass at lists.gemtalksystems.com
Tue Mar 29 11:26:57 PDT 2016
I can confirm this is fixed in 3.3.
Cheers,
On Fri, Nov 6, 2015 at 5:04 PM, Martin McClure <
martin.mcclure at gemtalksystems.com> wrote:
> On 11/06/2015 12:01 PM, Mariano Martinez Peck wrote:
> >
> >
> > On Fri, Nov 6, 2015 at 4:51 PM, Martin McClure
> > <martin.mcclure at gemtalksystems.com
> > <mailto:martin.mcclure at gemtalksystems.com>> wrote:
> >
> > On 11/06/2015 11:10 AM, Mariano Martinez Peck via Glass wrote:
> > > Hi,
> > >
> > > '[ :co |
> > > | d |
> > > co collect: [ d := 0 ] ]
> > > ' evaluate isSimple
> > >
> > > Answers false and #_cost answers 2 (complex).
> > > It seems related to the assignment of a temp var (defined inside
> the
> > > closure... 'd' in my example) from inside another closure ( [d :=
> 0] in
> > > my example)
> > >
> > > Any idea why? Of course that is a dummy closure that I reduced
> from my
> > > original one in order to the have the smaller reproducible closure
> to
> > > illustrate my problem.
> > >
> > > Thanks in advance,
> >
> > In 3.2.x, the outer block is not simple because the inner block is
> not
> > simple. The inner block is not simple because it accesses a variable
> > outside of its own scope.
> >
> >
> > Sure, but I am sending the message to the outer block, not the inner
> block.
> >
> >
> > I understand that the outer block's result is somewhat surprising.
> >
> >
> > Yes, I think it should be considered a bug because THAT closure (the one
> > I am sending the message) IS SIMPLE. Right?
>
> I don't recall the exact details, but I think that the way blocks in
> 3.2.x are handled internally, the outer block is actually not simple (in
> the way it's handled internally). Blocks are handled differently in 3.3,
> so the outer block can be simple, as you'd expect.
>
> Regards,
>
> -Martin
>
>
--
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20160329/98a01e7a/attachment-0001.html>
More information about the Glass
mailing list