David Storrs writes: > On Tue, Jul 06, 2004 at 06:39:07PM -0600, Luke Palmer wrote: > > Matija Papec writes: > > > > > > Would there be a way to still use simple unquoted hash keys like in old > > > days ($hash{MYKEY})? > > > > Of course there's a way to do it. This is one of those decisions that I > > was against for the longest time, until one day something clicked and it > > made sense. > > Out of curiosity, can you articulate what clicked? This one still > doesn't make sense to me, and I'd like to get it.
I don't know, actually. Some of Larry's ideas have a tendency to do that with me. It felt wrong, and then after that short painful time, it felt very right. Sort of like... um... nevermind. > > You might do it something like this: > > > > macro postcircumfix:{} ($base, $subscript) > > is parsed( / $?subscript := (\w+) /) > > { > > return { $base.{"$subscript"} } > > } > > > I don't recall seeing postcircumfix before, nor can I find it in > A6...did I miss something? > > Are there others, aside from these: ? > > prefix: a unary prefix operator > infix: a binary infix operator > postfix: a binary suffix operator > circumfix: a bracketing operator Tons. From A12: Category Example of use -------- -------------- coerce:as 123 as BigInt, BigInt(123) self:sort @array.=sort term:... $x = {...} prefix:+ +$x infix:+ $x + $y postfix:++ $x++ circumfix:[] [ @x ] postcircumfix:[] $x[$y] or $x .[$y] rule_modifier:p5 m:p5// trait_verb:handles has $.tail handles Âwag trait_auxiliary:shall my $x shall conformÂTR123 scope_declarator:has has $.x; statement_control:if if $condition {...} else {...} infix_postfix_meta_operator:= $x += 2; postfix_prefix_meta_operator: @array Â++ prefix_postfix_meta_operator: - @magnitudes infix_circumfix_meta_operator: @a Â+ @b Though I have a suspition that those are just examples, and some of them won't make it. Plus, he forgot: grammatical_category:postcircumfix :-) This is one of those things that isn't going to be so much designed into the language but defined by the implementation. "Where can we fit grammatical hooks?" in addition to "Where are they most useful?" Luke