develooper Front page | perl.perl5.porters | Postings from November 1999

Re: making pragmas?

Thread Previous | Thread Next
Larry Wall
November 20, 1999 10:25
Re: making pragmas?
Message ID: writes:
: Ilya Zakharevich (lists.p5p):
: >No need for this.  Hint variables have an infinite width now.  What is
: >important is how a module is going to *use* these hints.  Here my
: >macro=user-defined-ops patch would come in handy.  ;-)
: I thought of another way to do this earlier this morning, while thinking
: about extending the syntax from user-space. (The while(){} got me
: thinking about having loop{}, which could be implemented either as
: either a block-prototyped function, a preprocessor macro or as
: user-defined syntax) Unfortunately the solution I came up with includes
: the words `bootstrap the parser', which would probably get me lynched.

Especially if you say you also want the parser object oriented.  :-)

I personally think we should explore inlining block-prototyped
functions.  We ought to be able to lose both the sub call overhead
(two nested sub calls, actually) as well the closure construction
overhead (if the closure parameter is inlined back into the same scope
in which the closure was originally defined).  And the line numbers
would stay correct, which is hard to do with preprocessor (text-based)

But despite the fact that Ilya has recently been behaving in a most
Ilyaesque fashion, I think we also need to go back and look more at his
macro=user-defined-ops patch.  I confess that I've been thinking kindly
of user-defined ops primarily as a way of sneaking Unicode ops into
Perl so we can turn Perl into a superset of APL. :-) But operators do
have certain syntactic privileges that functions don't (and vice versa,
I think), so we need to weigh those things against each other.  The
two approaches may actually be complementary.  One would like to
inline operators too, after all.  I'm inclined to think of user-defined
operators as a funny way of prototyping functions.

Doubtless the caffeine will hit soon, and I'll realize I've been
talking nonsense.  But I won't admit it.  :-)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About