More quoting issues

0 views
Skip to first unread message

Roie Marianer

unread,
Apr 16, 2005, 8:33:26 PM4/16/05
to perl6-c...@perl.org
OK, so I'm getting close to having everything work (<<>> gave me a hard time,
but I tamed it in the end). I noticed something weird about the <> construct:

pugs> %a
(('1' => 'a'), ('1 2' => 'both'), ('2' => 'b'))
pugs> %a{<1 2>}
'both'
pugs> %a{1,2}
('a', 'b')
pugs> %a{<1 2>,()}
('a', 'b')

I tried to look into things, and it seems that <1 2> acting like a scalar when
it's inside a hash subscript, but nowhere else; when I forced the final
parameter of doFetch to be False (Eval.hs line 402) I got the correct result.

I have no idea what's going on in there, so I thought I might throw this out
to whoever does. I'll try to go in deeper later, but sleep and homework await
me. (Also, I'm waiting for the repository to come back up, I want the
history).

Incidentally, %a<1 2> does work in the current version, but that's because
it's not a real quoting construct (which means it doesn't interpolate \>, for
example). I found the bug when I tried to make %a<1 2> act like "real" <>,
and broke it.

Oh, I'm on r2044. (Can't update, no svn.openfoundry.org)
--
-Roie
v2sw6+7CPhw5ln5pr4/6$ck2ma8+9u7/8LSw2l6Fi2e2+8t4TNDSb8/4Aen4+7g5Za22p7/8
[ http://www.hackerkey.com ]

Autrijus Tang

unread,
Apr 17, 2005, 12:29:30 AM4/17/05
to Roie Marianer, perl6-c...@perl.org
On Sun, Apr 17, 2005 at 03:33:26AM +0300, Roie Marianer wrote:
> I tried to look into things, and it seems that <1 2> acting like a
> scalar when it's inside a hash subscript, but nowhere else; when I
> forced the final parameter of doFetch to be False (Eval.hs line 402) I
> got the correct result.

You need to add a case to AST.hs line 580ish to tell it that <1 2>,
like (1,), /looks/ like a list, not a scalar.

> Oh, I'm on r2044. (Can't update, no svn.openfoundry.org)

Sorry for the downtime; it should be fixed in the next 18 hours or so...
Meanwhile, you can "svn switch" to this repository:

http://svn.perl.org/perl6/pugs/trunk/

and feel free to post patches on p6c, so I can apply them. :)

Thanks,
/Autrijus/

Reply all
Reply to author
Forward
0 new messages