A Lispy Forth for Smalltalk

Aaron J Reichow reic0024 at d.umn.edu
Mon Feb 16 04:44:29 UTC 2004


After playing with F-Script myself a while back, I implemented something
similar in Squeak.

> >x @foo: y
> >
> >to be syntactic sugar for
> >
> >x collect: [:ea | ea foo: y]

But instead of "x @foo: y", I just implemented a method- Collection>>#@
(which broke the method of the same name to create an array of points)
that allowed you to do it this way:

x @ foo: y

Not much different, just one space. And it didn't require any
modifications to the parser, or overwriting DNU at the level of Object. :)

Regards,
Aaron

--
  "the question is no longer between violence and non-violence; It is
between non-violence and non-existence."  :: martin luther king junior


On Sun, 15 Feb 2004, David Farber wrote:

>
> I've actually got this mostly coded up. I did the work over New Years break but haven't had the time to finish it. If this is something that people are really interested in, that'd give me extra incentive to finish it up.
>
> david
>
> At 02:41 PM 2/15/2004 -0800, you wrote:
> >
> >On Feb 15, 2004, at 12:54 AM, ducasse wrote:
> >
> >> avi
> >>
> >> have you looked at F-script and the OOPAL model presented at OOPSLA
> >> last year by philippe mougin.
> >> Because I still would like to see if this can be introduced in squeak
> >> with/without modifying the vm. I just have to
> >> find a good student and philippe is willing to help. I browsed the
> >> objective-C code and this is not really complex.
> >> http://www.iam.unibe.ch/~scg/Archive/Papers/Moug03aOOPALOOPSLA.pdf
> >
> >Yes, I've looked at F-script.  I don't see that we would need any VM
> >modifications to support it, just some compiler extensions.  We just
> >define, eg,
> >
> >x @foo: y
> >
> >to be syntactic sugar for
> >
> >x collect: [:ea | ea foo: y]
> >
> >and
> >
> >x foo:@ y
> >
> >to be syntactic sugar for
> >
> >y collect: [:ea | x foo: ea].
> >
> >x @foo:@ y then needs to be
> >
> >x collect: [:eaX | y collect: [:eaY | eaX foo: eaY]]
> >
> >and so on.  I haven't thought yet about what would happen with @@, but
> >I expect it should still basically be a macro expansion to sends of
> >#collect:.
> >
> >We could also use DNU to support his "implicit message patterns", which
> >would interpret "x foo: y" as "x @foo:@ y" if they were both Arrays,
> >but personally I would rather do without that.
> >
> >
> >
> --
> David Farber
> dfarber at numenor.com
>



More information about the Squeak-dev mailing list