Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

In(tro)spection and line counting

1 view
Skip to first unread message

Mark J. Reed

unread,
May 2, 2007, 3:04:00 PM5/2/07
to p6l
1. Are there any interactive inspection tools in the current Perl6
implementations? S12.pod talks about a "methods" method (on the
object returned by .HOW at least), but that doesn't seem to exist in
Pugs... I think in this stage where the impls are incomplete and
people are playing around with them (and looking for areas to help out
in) it would be helpful to have a way to ask 'what can this object
do?' from within the interpreter.

2. The question I was trying to answer by poking around: what is/will
be the P6 equivalent of P5's $. ? I assume the answer is a method on
the filehandle object, but called what? Should it keep the P5
IO::Handle name (input_line_number)? Or something else perhaps a
little less unwieldy (lineno, recno, ...)

I don't see any reference to $. in the Synopses, so I assume this is
not yet defined. Apologies if I just missed it.

--
Mark J. Reed <mark...@mail.com>

Larry Wall

unread,
May 2, 2007, 4:46:18 PM5/2/07
to p6l
On Wed, May 02, 2007 at 03:04:00PM -0400, Mark J. Reed wrote:
: 1. Are there any interactive inspection tools in the current Perl6

: implementations? S12.pod talks about a "methods" method (on the
: object returned by .HOW at least), but that doesn't seem to exist in
: Pugs... I think in this stage where the impls are incomplete and
: people are playing around with them (and looking for areas to help out
: in) it would be helpful to have a way to ask 'what can this object
: do?' from within the interpreter.

Yes, this is why MO integration is the next milestone in pugs.
The parrot folks are also heavily at work in the meta-object area.

: 2. The question I was trying to answer by poking around: what is/will


: be the P6 equivalent of P5's $. ? I assume the answer is a method on
: the filehandle object, but called what? Should it keep the P5
: IO::Handle name (input_line_number)? Or something else perhaps a
: little less unwieldy (lineno, recno, ...)

Probably something shorter. The problem with "lines" is that they aren't
necessarily lines. But "records" is so 1960s... Also, anything that
names the units could be seen as the count of those units in the file as
a whole rather that the number read up till now.

Tempted to have $io.sofar or some such...

: I don't see any reference to $. in the Synopses, so I assume this is


: not yet defined. Apologies if I just missed it.

There's a prototype synopsis on variables out in pugs/docs/AES but it's
still pretty rudimentary.

As for $. itself as a variable, it's dead. Its "twigil" has been stolen
by $.foo for object attributes, and we're trying not to reuse twigils
for bare variable names, though it comes to mind that we have both $! and
$!foo currently. But there are very, very few punctuational variables
in Perl 6 compared to Perl 5. Most of 'em are just gone.

Larry

Mark J. Reed

unread,
May 8, 2007, 8:29:17 AM5/8/07
to p6l
On 5/2/07, Larry Wall <la...@wall.org> wrote:
> : 2. The question I was trying to answer by poking around: what is/will
> : be the P6 equivalent of P5's $. ? I assume the answer is a method on
> : the filehandle object, but called what? Should it keep the P5
> : IO::Handle name (input_line_number)? Or something else perhaps a
> : little less unwieldy (lineno, recno, ...)
>
> Probably something shorter. The problem with "lines" is that they aren't
> necessarily lines. But "records" is so 1960s...

"chunks"?

> Also, anything that names the units could be seen as the count of those units in the file
> as a whole rather that the number read up till now.

Yeah, that's why I suggested the names with "...no". Although that's
not necessarily clear, especially to non-native English speakers.
"...num" might be better...

> Tempted to have $io.sofar or some such...

Maybe there could be different (adverbial?) variants of .tell for
different units? Bytes, lines (actual lines irrespective of whatever
the record separator is set to), chunks?

> There's a prototype synopsis on variables out in pugs/docs/AES but it's
> still pretty rudimentary.

Ah, thanks! Missed that.

> As for $. itself as a variable, it's dead.

Yeah, kinda figured.

> there are very, very few punctuational variables in Perl 6 compared to Perl 5. Most of
> 'em are just gone.

And a cheer went up from the multitude... :)

Thanks again for the reply.

0 new messages