Dragaera

Re Re: A priority queue & A nice ADT packaging style

Maximilian Wilson wilson.max at gmail.com
Sun Dec 11 09:33:45 PST 2005

On 12/11/05, Björn Hägglund <bjohag at home.se> wrote:
>
>
> > Ultimately, though, I don't think functors are the way to go for making
> > objects. I'm too worried about overhead, and functors don't really seem
> to
> > be designed for creating objects so much as modules.
>
> Yes, you are probably right. I was actually just looking for nicer syntax
> to
> provide ADT:s in the style described. But it seems that functors are not
> able to the job. I think I'll simply continue to use lexical closures,
> then.
>

Have you played around with Gump? The CTM book suggests in several places
that sufficiently-common idioms be given linguistic support, and I've heard
people on this list suggest that e.g. some kinds of operator overloading
(arithmetic on imaginary numbers) are best done with Gump rather than
extending Oz itself, but I've never gotten deep enough into Gump to figure
out how to do it. I think it would be very cool to create new linguistic
constructs purely from a grammar and a translation into core syntax; but I
don't really know how you'd approach it. I understand the compiler parses
text and not abstract syntax trees, so you couldn't just use gump to parse
the text and then feed a modified AST to the compiler; I'm not sure how
you'd do it.

Max Wilson

--
Be pretty if you are,
Be witty if you can,
But be cheerful if it kills you.