Eduardo Cavazos wrote:

> > I.e. you'd need an 'EXTEND:' for every generic you're extending. Thus
> > the 'IN:' is a cleaner route.
> >
> > If you don't explicitly use 'IN:' or 'EXTEND:', then a new generic
> > will be
> > created in the current vocabulary.

Joe Groff wrote:

> I like that idea. What if EXTEND: word were the actual defining word,
> so instead of saying this:
>
> EXTEND: nth sequences
>
> : nth ( :my-sequence -- elt ) ... ;
>
> you could just say:
>
> EXTEND: nth sequences ( :my-sequence -- elt ) ... ;
>
> That would require less bookkeeping in the parser, and it's unlikely
> you'd use an EXTEND: separate from a definition.

There could be a way to do a one-shot extension like that, but I wouldn't 
hijack the 'EXTEND:' form for this purpose because it serves a different 
case. For example, if you want to put many methods on 'nth' you wouln't want 
to do:

        EXTEND: nth sequences ... ;

For each method. You'd just want to put a single 'EXTEND:' form to indicate 
that 'nth' is being extended.

Also, the point here is to move *away* from verbose defining forms for 
methods.

I'm not sure about what that one-shot syntax would be however. Notice that 
this isn't bad looking and it involves no new words:

        IN: sequences : nth ( :integer :frob -- obj ) ... ;

The only issue is having to switch back to the original vocabulary.

Ed

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to