Re: In(tro)spection and line counting

2007-05-08 Thread Mark J. Reed

On 5/2/07, Larry Wall [EMAIL PROTECTED] 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.

--
Mark J. Reed [EMAIL PROTECTED]


Re: In(tro)spection and line counting

2007-05-02 Thread Larry Wall
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