Following the request for ideas on IO, this is my wish list for working
with files. I am not a perl guru and so I do not claim to be able to
write specifications. But I do know what I would like.
The organisation of the IO as roles seems to be a great idea. I think
that what is suggested here
On 2008-Dec-14, at 11:21 am, Moritz Lenz wrote:
Uri Guttman wrote:
how is sort ordering specified?
Currently it is not specified, it defaults to infix:. If you
can suggest a non-confusing way to specify both a transformation
closure and a comparison method, please go ahead.
how does it k
On Mon, Dec 15, 2008 at 10:43 AM, Richard Hainsworth
wrote:
> a) I am fed up with writing something like
>
> open(FP, ">${fname}_out.txt") or die "Cant open ${fname}_out.txt for
> writing\n";
>
> The complex definition of the filename is only to show that it has to be
> restated identically twice.
On Mon, Dec 15, 2008 at 5:43 PM, Richard Hainsworth
wrote:
> Following the request for ideas on IO, this is my wish list for working with
> files. I am not a perl guru and so I do not claim to be able to write
> specifications. But I do know what I would like.
>
> The organisation of the IO as rol
> "LT" == Leon Timmermans writes:
>> e) When dealing with files in directories in perl5 under linux, I need
>>
>> opendir(DIR,'./path/') or die "cant open ./path/\n";
>>
>> my @filelist = grep { /^.+\.txt/ } readdir(DIR);
>>
>> I would prefer something like
>>
>> my Loca
>> infix: does numeric comparison if both operands are numbers, and
>> string comparison otherwise.
That is a bit of an oversimplification.
> "Cmp" (like "eqv") depends on the particular type, so to sort a certain
> way, you should need only to coerce the values to the right type:
>
> @st
On Sun, Dec 14, 2008 at 09:33:20PM +0100, Moritz Lenz wrote:
: Moritz Lenz wrote:
: > From S29:
: >
: > : =item end
: > :
: > : our Any method end (@array: ) is export
: > :
: > : Returns the final subscript of the first dimension; for a one-dimensional
: > : array this simply the index of the fi
On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
> HaloO,
>
> Carl Mäsak wrote:
>> Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
>> dies of despair.
>>
>> My guess is that the semantics of Pugs and Elf falls out naturally
>> form a pair being treated as a list of two el
-- Original message --
From: Larry Wall
> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
> > My idea is to let a pair numify to whatever the value numifies to.
> > Same thing with stringification. In general I think that a pair should
> > hide its key as far a
> "LW" == Larry Wall writes:
>>> infix: does numeric comparison if both operands are numbers, and
>>> string comparison otherwise.
LW> That is a bit of an oversimplification.
LW> Any type may define infix: however it likes for two arguments of
LW> its own type. It may also defin
> "mab" == mark a biggar writes:
mab> -- Original message --
mab> From: Larry Wall
>> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
>> > My idea is to let a pair numify to whatever the value numifies to.
>> > Same thing with stringification. I
Mark Biggar wrote:
> The only use case I can think of is sorting a list of pairs;
> should it default to sort by key or value?
But this isn't a case of numifying a Pair, or of stringifying it - or
of coercing it at all. If you've got a list of Pairs, you use a
sorting algorithm that's designed f
On 2008-Dec-15, at 4:18 pm, Jon Lang wrote:
If you've got a list of Pairs, you use a sorting algorithm that's
designed for sorting Pairs (which probably sorts by key first, then
uses the values to break ties).
Agreed.
If you've got a list that has a mixture of Pairs and non-Pairs, I
think
Leon Timmermans wrote:
On Mon, Dec 15, 2008 at 5:43 PM, Richard Hainsworth
wrote:
a) I am fed up with writing something like
open(FP, ">${fname}_out.txt") or die "Cant open ${fname}_out.txt for
writing\n";
The complex definition of the filename is only to show that it has to be
restated ident
do {
die 'some text';
say 'after the exception';
CATCH {
say 'caught the exception';
...; # what goes here?
}
}
My proposal is to call .resume() on the exception object.
Thoughts?
Larry Wall wrote:
> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
>> HaloO,
>>
>> Carl Mäsak wrote:
>>> Pugs and Elf currently numify a Pair object to 2, and Rakudo currently
>>> dies of despair.
>>>
>>> My guess is that the semantics of Pugs and Elf falls out naturally
>>> form a pair being
On Mon, Dec 15, 2008 at 6:42 PM, jason switzer wrote:
> It's lazy and kinda cheating, but for small simple tasks, it gets the job
> done. I'm not up to speed with the IO spec, but a sort of auto-slurp
> functionality would be nice. Something to the effect:
>
> @data = :slurp("mydatafile.txt");
A
On Mon, Dec 15, 2008 at 8:47 PM, Stephen Weeks wrote:
> do {
>die 'some text';
>say 'after the exception';
>CATCH {
>say 'caught the exception';
>...; # what goes here?
>}
> }
>
> My proposal is to call .resume() on the exception object.
>
> Thoughts?
>
The spec sa
do {
die 'some text';
say 'after the exception';
CATCH {
say 'caught the exception';
...; # what goes here?
}
}
My proposal is to call .resume() on the exception object.
Thoughts?
mark.a.big...@comcast.net wrote:
> -- Original message --
> From: Larry Wall
>> On Thu, Dec 11, 2008 at 02:24:54PM +0100, TSa wrote:
>> > My idea is to let a pair numify to whatever the value numifies to.
>> > Same thing with stringification. In general I think that
Uri Guttman wrote:
>> "LW" == Larry Wall writes:
>
> >>> infix: does numeric comparison if both operands are numbers, and
> >>> string comparison otherwise.
>
> LW> That is a bit of an oversimplification.
>
> LW> Any type may define infix: however it likes for two arguments of
>
On Mon, Dec 15, 2008 at 5:41 PM, Moritz Lenz wrote:
> I know at least of infix:(Num $a, Num $b) (which does the same as
> Perl 5's <=>) and infix:(Pair $a, Pair $b) (which does $a.key cmp
> $a.key || $a.value cmp $b.value), so numbers and pairs DWIM.
Hm. Rakudo doesn't let me cmp pairs at all
On Mon, Dec 15, 2008 at 6:59 PM, Leon Timmermans wrote:
> On Mon, Dec 15, 2008 at 6:42 PM, jason switzer wrote:
> > It's lazy and kinda cheating, but for small simple tasks, it gets the job
> > done. I'm not up to speed with the IO spec, but a sort of auto-slurp
> > functionality would be nice.
23 matches
Mail list logo