in reply to Re (tilly) 1: Polymorphic prototypes? (creating new syntax)
in thread Polymorphic prototypes? (creating new syntax)

Too get a sense of how far you can go with those ideas, take a look at Lingua::Romana::Perligata (but don't blame me if you lose your sanity)...

:) I almost started studying latin just to be able to code in Perligata... I just find the idea of coding perl in latin incredibly cool.

Dispatch on prototype? What do you mean? That expression is alien to me, but I don't see a problem with prototype polymorphism. Hook up a list of possible matches for invocation compile-time and only if the sub is prototyped to be polymorphic, if the number of matches != 1, complain. Mmm? Of course this would only work with prototypes, who already generate syntax errors on incorrect invocation. How this relates to anonymous functions and whatnot, I dunno, but you can't defined prototypes for those anyways, can you?

-Kaatunut

  • Comment on Re: Re (tilly) 1: Polymorphic prototypes? (creating new syntax)

Replies are listed 'Best First'.
Re (tilly) 3: Plymorphic prototypes? (creating new syntax)
by tilly (Archbishop) on Apr 08, 2001 at 22:36 UTC
    By dispatch on prototype I mean that when Perl looks up a function it can figure out what function to call based on the name and the look of the arguments.

    As for whether it is doable, probably. It would be hairy. It would not fit well in the list-oriented nature of Perl. People often find the APIs they create with such facilities to be very confusing. And Perl does not support it because it does not support having 2 functions in the same package of the same name at the same time.

    Anyways about prototypes, I completely side with Tom Christiansen on this. Unless you have a darned good reason you need them, they are a bad idea in Perl...

Re: Re: Re (tilly) 1: Polymorphic prototypes? (creating new syntax)
by princepawn (Parson) on Apr 09, 2001 at 21:01 UTC
    While you're at it, take a look at Michael Schwern's DNA and Leon Brocard's Buffy, then you can code Perl in DNA sequences and various capitalizations of Buffy and have it work!

    All these magics are due to Paul Marquess' Filter::Cpp (I believe it's called).