Today I'm back to Tamsui, the location for the first Pugs Hackathon with my brother Bestian, exactly one lunar year ago. However, it seems silly to write two anniversary journal entries, so that will wait until the common-era anniversary in Feb 1st.
Meanwhile, putter, gaal, bsmith and I were working in around-the-timezones shifts on 6.2.11 bug triaging, with a new TASKS file introduced by putter and bsmith as a lightweight issue tracking system.
We are finally close to the finishing line -- less than 200 subtests failures in the main test suite. In particular, interaction between named arguments and demagicalized pairs now conforms to the much saner subroutine spec.
However, I keep getting distracted of implementing useful feature suggestions from #perl6. For example, jvoorhis (our new committer who hacks ruby as part of day job) tried constructing a new class in the interactive Pugs shell, and found it very broken:
pugs> class Foo {
Internal error while running expression:
***
unexpected end of input
expecting end of input, ";", statements or "}"
at <interactive> line 1, column 12
So he asked on #perl6 if Perl 6 allows runtime class creation. Of course we do; the bug is in the use of line-based input. Compare the behaviours of entering "1+\n2" in Python and irb (Ruby shell):
$ python
>>> 1+
File "<stdin>", line 1
1+
^
SyntaxError: invalid syntax
>>> (1+
... 2)
3
$ irb
irb(main):001:0> 1+
irb(main):002:0* 2
=> 3
Clearly, irb's behaviour is far more intuitive, as it allows people pasting whole programs into the interactive shell -- although the Python behaviour is also quite consistent, as it allows "1\n+2" but not "1+\n2" in a file-based program either.
It turned out to be a simple 10-line patch to Pugs, so these cases now work:
pugs> class Foo {
....> has $.bar;
....> }
undefpugs> 1+
....> 2
3
Moreover, I've fixed the annoying bug of readline segfaulting under threaded Pugs, by disabling signal and sigwinch handlers. Expect more triaging tomorrow...
Python's error has nothing to do with the interactive editors. It's the Python syntax.
1+
2
isn't valid.
(1+
2)
is, and works both in a file and in the Python shell.
Also, the thing ruby displays to the left by default when interacting is a little too verbose IMO. It leaves too little space in an 80-column terminal, and the extra information is something I don't find interesting 99% of the time.
Posted by: Ben Atkin | 2006.01.30 at 08:56 AM
Also, when splitting a line at a binary operator, I prefer to put the operator on the second line. I also think the parens make it look more clear (it's part of the GNU coding conventions). I don't think it's a bug.
Posted by: Ben Atkin | 2006.01.30 at 08:59 AM
Ben: Thanks for the info, I stand corrected. :-)
The article has been updated to reflect this new understanding as well.
Posted by: Audrey T | 2006.01.30 at 09:31 AM
When Perl6 will be officially announced? Tom at LmhSoft
Posted by: Tom Carvin | 2006.06.20 at 01:52 PM
By Christmas.
Posted by: Audrey T | 2006.06.20 at 06:53 PM