Re: Perl6 Macros

2002-03-28 Thread Luke Palmer
How about we implement some way to peer into coderefs? Maybe just on the top level, with attributes, or maybe a syntax tree (probably not). Because here, what both arguments (in the discussion) are missing, is the ability to look at their arguments' (the uh, ones you pass in) internal struct

Re: Perl6 Macros

2002-03-28 Thread Simon Cozens
Aaron Sherman: > This just brought something to mind when I re-read it. I was thinking > about how this would transform back into Perl, and I thought... gee, you > can't do that easily because you're taking the result of a block, and > Perl can only do that via function call or eval, Or do, whic

A thought occured to me...

2002-03-28 Thread Piers Cawley
Wouldn't it be nice if you could do: class Foo { ... &{intern('{}')} := method ($self: $key) is lvalue { ... } } So, later, you could do: $obj = Foo.new; $obj{something} = $something_else; ie, overriding hash lookups, array lookups, whatever. (I'm using a Lispish 'intern

Re: A thought occured to me...

2002-03-28 Thread Simon Cozens
Piers Cawley: > ie, overriding hash lookups, array lookups, whatever. Ah, you want C#/Python indexers, you do. So do I. -- "If that makes any sense to you, you have a big problem." -- C. Durance, Computer Science 234

Re: A thought occured to me...

2002-03-28 Thread Piers Cawley
Simon Cozens <[EMAIL PROTECTED]> writes: > Piers Cawley: >> ie, overriding hash lookups, array lookups, whatever. > > Ah, you want C#/Python indexers, you do. So do I. Um... is that what you call 'em. Actually, you can already do 'use overload q|%{}|', to sort of do this... -- Piers "It i

Re: A thought occured to me...

2002-03-28 Thread Dan Sugalski
At 12:59 PM + 3/28/02, Piers Cawley wrote: >Wouldn't it be nice if you could do: > >class Foo { > ... > > &{intern('{}')} := method ($self: $key) is lvalue { > ... > } >} > >So, later, you could do: > >$obj = Foo.new; > >$obj{something} = $something_else; > >ie, overriding

Re: Perl6 Macros

2002-03-28 Thread Aaron Sherman
On Wed, 2002-03-27 at 19:46, Michel J Lambert wrote: > > Macros could add something to Perl, but I don't see why having a macro > > return a string instead of looking and acting like a subroutine would be > > a bad thing. In fact, as I pointed out before, you can do almost all of > > the scoping

Re: Perl6 Macros

2002-03-28 Thread Aaron Sherman
On Thu, 2002-03-28 at 10:19, Aaron Sherman wrote: > Here's what I suggest as a compromise: > > macro forall ($iterator, $list, $block) { > my @ltmp = ($list); > foreach $iterator -> @ltmp $block > } > forall{$var}{@list}{{print;}}; > > Where the parser sees "macro NAME P