On 11/17/2010 10:08 PM, Martin D Kealey wrote:
Dimensioned numbers as restrictive types are useful, for uncovering bugs,
including sometimes latent ones in ported code.
Duration is a fairly clear example of a dimensioned quantity, and I think we
should think twice about abandoning its
Buddha Buck wrote:
Is it too late in this discussion to point out that, in non-perl
usage, eigenstates are associated with the operator, not with the
value fed into the operator?
[cut]
So asking for the eigenstates of a quantum superposition is asking the
wrong object for the property.
Damian Conway wrote:
So I'm going to go on to propose that we create a fifth class of
Junction: the transjunction, with corresponding keyword Cevery.
[...]
say (^10 G[] one(3,7));
3 4 5 6
which could also be:
say every(^10) one(3,7);
# Every value up to 10 that's greater than 3
Damian Conway wrote:
Yes, Ted Z. pointed out to me that, as the name of this construct,
every has ambiguity and synonym issues. Other possibilities are:
select(@values) one(3..7)
those(@values) one(3..7)
whichever(@values) one(3..7)
itemize(@values) one(3..7)
Damian Conway wrote:
I've been thinking about junctions, and I believe we may need a small
tweak to (at least) the jargon in one part of the specification.
When this issue has been raised in the past, the response has been that
junctions are not really intended to be useful outside of the
Damian Conway wrote:
Perhaps we need to think more Perlishly and reframe the entire question.
Not: What threading model do we need?, but: What kinds of non-sequential
programming tasks do we want to make easy...and how would we like to be
able to specify those tasks?
The mindset that I use
Matthew wrote:
use base 16;
my $a = 10;
say $a;
puts the number 0x10 into $a, and outputs `10'. Here, say $a.fmt('%d')
would output `16'.
As someone who has implemented, and used, mini-languages with such a
feature, I'd say that the confusion that it would cause does
significantly
Michael Zedeler wrote:
This is exactly why I keep writing posts about Ranges being defunct as
they have been specified now. If we accept the premise that Ranges are
supposed to define a kind of linear membership specification between two
starting points (as in math), it doesn't make sense
Moritz Lenz wrote:
Dave Whipp wrote:
for 0..10 - $x { ... }
is treated as
for (0...10).pick(*) - $x { ... }
Sorry, I have to ask. Are you serious? Really?
Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I
think I will:
Was my specific proposal entirely
Moritz Lenz wrote:
I fear what Perl 6 needs is not to broaden the range of discussion even
further, but to narrow it down to the essential points. Personal opinion
only.
OK, as a completely serious proposal, the semantics of for 0..10 { ...
} should be for the compiler to complain sorry,
Aaron Sherman wrote:
On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp d...@dave.whipp.name wrote:
To squint at this slightly, in the context that we already have 0...1e10 as
a sequence generator, perhaps the semantics of iterating a range should be
unordered -- that is,
for 0..10 - $x
Darren Duncan wrote:
Dave Whipp wrote:
Similarly (0..1).Seq should most likely return Real numbers
No it shouldn't, because the endpoints are integers.
If you want Real numbers, then say 0.0 .. 1.0 instead.
-- Darren Duncan
That would be inconsistent. $x ~~ 0..1 means 0 = $x = 1. The fact
nigelsande...@btconnect.com wrote:
There are very few algorithms that actually benefit from using even low
hundreds of threads, let alone thousands. The ability of Erlang (and go
an IO and many others) to spawn 100,000 threads makes an impressive demo
for the uninitiated, but finding
nigelsande...@btconnect.com wrote:
From that statement, you do not appear to understand the subject matter
of this thread: Perl 6 concurrency model.
If I misunderstood then I apologize: I had thought that the subject was
the underlying abstractions of parallelism and concurrency that perl6
Daniel Ruoso wrote:
Hi,
The threading model topic still needs lots of thinking, so I decided to
try out some ideas.
Every concurrency model has its advantages and drawbacks, I've been
wondering about this ideas for a while now and I think I finally have a
sketch. My primary concerns were:
1
masak wrote:
Modified:
docs/Perl6/Spec/S32-setting-library/Numeric.pod
Log:
[S32/Numeric] removed method form of srand
Overwhelming consent on #perl6 about this.
- multi method srand ( Real $seed: )
multi srand ( Real $seed = default_seed_algorithm())
Seed the generator Crand uses.
Moritz Lenz wrote:
1) A RNG class (don't really care what the name is, for now)
2) An instance of that in $*RAND (which you can temp())
3) rand() and srand() act on $*RAND
4) It should be easy to create instances of the RNG to use in your own
class.
The sounds reasonable. The one thing I'd
Moritz Lenz wrote:
Dave Whipp wrote:
[cut] Contrast with Rat which has both separate accessors and the
nude method (a name that could possibly be improved to avoid
adult-content filters)
suggestions welcome.
Attempting to generalize: what we want is an operator that extracts a
Seq
Jon Lang wrote:
my ($num, $denom) = $num.^attr; # $num.WHAT == Ratio;
my ($mag, $phase) = Complex::Polar($z).^attr;
my ($re, $im) = Complex::Cartesian($z).^attr;
my ($x, $y) = $vector.^attr »·« ( [1, 0], [0, 1] );
If I'm reading this right, the .^attr is exposing implementation details
Doug McNutt wrote:
my ($x, $y) = $vector «·« ( [1, 0], [0, 1] );
After a while I became resigned to the fact that dot and cross
products were not what was being offered. Instead a product of two
vectors was to be simply a component by component multiply that
produced another vector of the
Todd Olson wrote:
At 14:54 -0500 2009-12-17, Jon Lang wrote:
And really, my whole point is that the implementation details are
(conceptually) the only thing that distinguishes Complex::Polar from
Complex::Cartesian.
All though both e^(i ¼) and e^(i 3 ¼) evaluate to -1 + 0i
it is often
The definition of the Complex type seems a little weak. A few things:
To get the Cartesian components of the value there are two methods (re
and im). In contrast there is just one method polar to return the
polar components of the value I'm not sure that this asymmetry is a good
thing.
Moritz Lenz wrote:
our multi method polar (Complex $nim: -- [ Real $mag where 0..Inf,
Real $angle where -π ..^ π ]) is export { ... }
If you put this into a signature, it is checked on every call to that
method and thus slows down execution. If you want a formalization that's
not part of
yary wrote:
At 00:15 +0100 12/17/09, Moritz Lenz wrote:
Not quite, .abs returns one of the polar coordinates (the magnitude), so
only a method is missing that returns the angle.
Any ideas for a good name?
Would a method called phi with a unicode synonym φ be too obtuse?
Anything wrong
Leon Timmermans wrote:
Reading this discussion, I'm getting the feeling that filename
literals are increasingly getting magical, something that I don't
think is a good development. [...]. I don't want to deal with Windows'
strange restrictions on characters when I'm working on Linux. I don't
Ovid wrote:
I'd like to see something like this (or whatever the equivalent Perl 6 syntax
would be):
class PracticalJoke does Bomb does SomeThingElse {
method fuse() but overrides { ... }
}
The overrides tells Perl 6 that we're overriding the fuse() method
from either Bomb or
Richard Hainsworth wrote:
Thinking about Jon Lang's -1|+1 example in another way, I wondered about
simultaneous conditions.
Consider
$x = any (1,2,5,6)
How do we compose a conditional that asks if any of this set of
eigenstates are simultaneously both 2 and 5?
Clearly the desired answer
Jon Lang wrote:
[proposal that conditional statements should collapse junctions]
$x = +1 | -1;
if $x 0 { say $x is positive. }
else { say $x is negative. }
I suspect that both codeblocks would be executed; but within the first
block, $x == +1, and within the second codeblock, $x
Mark J. Reed wrote:
[I] wrote:
So I'd vote for going with simple semantics that are easy to explain --
that is, don't attempt implicit junctional collapse. Provide operators to
collapse when needed, but don't attempt to be too clever.
While it's easier to find clever programmers than to
Richard Hainsworth wrote:
The following arose out of a discussion on #perl6. Junctions are new and
different from anything I have encountered, but I cant get rid of the
feeling that there needs to be some more flexibility in their use to
make them a common programming tool.
I strongly agree
[I’d been planning to put this suggestion on hold until the spec is
sufficiently complete for me to attempt to implement it as a module. But
people are discussing this again, so maybe it's not just me. I apologize
if I appear to be beating a dead horse...]
Jon Lang wrote:
Maybe you could
Larry Wall wrote:
Note however that coercions require parens these days, since types parse
as values, not as routine names.
$x = Role::Serializable::XML($resultset);
$y = Role::Serializable::YAML($resultset);
Should indirect object syntax work in this context?:
$a = Foo: $value;
S04 mentions that statement modifiers behave as for perl5 (excpet that
you can have both an conditional modifier and a looping modifier on a
single statement.
Both then it gives this example, with be modifiers being operators
within an expression, not as modifiers of a statement.
line
Jon Lang wrote:
Keys, OTOH, don't have any such requirement; so continuous keys may
very well be doable. If they _are_ doable, you have to ask questions
such as how do I assign values to a continuous interval of keys? To
truly be robust, we ought also answer this question in terms of
I'm getting a bit lost following precisely what's being proposed. What
I'm sort of feeling is that there are two fundamental immutable types
needed: Instants and Durations:
multi sub infix:- (Instant, Instant -- Duration)
multi sub infix:+ (Instant, Duration -- Instant)
multi sub infix:-
Daniel Ruoso wrote:
Maybe I'm thinking sideways again, but I haven't thought of open as
being a method of any IO object, because usually open is the thing
that gets you an IO Object.
I'd expect the plain open to be really a sub (maybe a is export
method in the generic IO role), that does
Jon Lang wrote:
Pattern to split on (used with -a). Substitutes an expression for the default
split function, which is C{split ' '}. Accepts unicode strings (as long as
Should the default pattern be ' ', or should it be something more like /\s+/?
/ws/ ?
Darren Duncan wrote:
I don't quite follow you. Are you saying your version of sqrt is an
implicit declaration; maybe I don't understand how that differs from an
explicit definition in this case? In any event, right at this moment I
can't think of an answer to your question. Go ahead with
Timothy S. Nelson wrote:
method foo() does assumeconserve_sum { ... }
method bar() does ensureconserve_sum { ... }
Is ensure equivalent to the assert that you describe above?
Yes. does ensure was meant to be an englishification of
postcondition; and does assume is precondition.
Larry Wall wrote:
On Fri, Jan 23, 2009 at 08:01:14AM -0800, Dave Whipp wrote:
For example, I could conceive of a trait:
ok foo, :brokenrakudo
which might downgrade the error to a warning on rakudo, but not on other
implementations.
On the surface that seems like a good idea, and pugs
Larry Wall wrote:
module MyTests {
sub group1 {
ok foo :nametest_foo; ## Q - would a label be better?
}
}
## Elsewhere
MyTests.group1.test_foo is also brokenrakudo;
I guess I don't see offhand what you're trying to do with that.
...
We must keep a clean
separation
jerry gay wrote:
i don't understand the drive to have unique test identifiers. we don't
have unique identifiers for every code statement, or every bit of
documentation. why are tests so important/special/different that each
warrants a unique id? that aside, this functionality sounds like it
can
Darren Duncan wrote:
Dave Whipp wrote:
sub sqrt(Num where { 0 = $_ = Real::Max } $x) {
(0..$x/2 :by(Real::Epsilon)).min: { abs $x - $^candidate ** 2 }
}
So do you really mean as declarative a manner as possible? Or would
you consider this example to go beyond possible?
I would declare
Moritz Lenz wrote:
A few months ago Larry proposed to add some testing
facilites to the language itself, because we want to
culturally encourage testing, and because the test
suite defines the language, so we need to specify the
behaviour of our testing facilities anyway.
If we're going to
Moritz Lenz wrote:
$x == 1e5 :ok('the :ok makes this is a test');
I can't help feeling that there's an end-weight problem here: The fact
that it is a test is the essence of statement.
If we're thinking of it as a library, then the MMD way of thinking might
be appropriate: we know
Darren Duncan wrote:
1. What we *should* be doing with the Prelude, like with STD.pm, is
write under the assumption that the implementation is also written in
Perl 6.
We should write the Prelude in as declarative a manner as possible,
saying *what* we want to happen rather than how, such as
Ovid wrote:
$string.trim(:leading0);
$string.trim(:trailing0);
Setting leading or trailing to false (they default to true) would
result in either leading or trailing whitespace not being trimmed
Alternatively, those could be ltrim() and rtrim(). If you need to dynamically
determine
Jon Lang wrote:
I believe that we already have a signature creation operator, namely
:( @paramlist ).
Yes, sorry, I missed that.
...
Regardless, the magic that makes this work would be the ability to
assign a flat list of values to a signature. Is this wise?
We already have the ability
Daniel Ruoso wrote:
Hmm... I think that takes the discussion to another level, and the
question is:
what does a capture returns when coerced to a context it doesn't
provide a value for?
I'd like to take one step further, and ask what it is that introduced
capture semantics in the first
I spent a fair amount of time with Rakudo over the holiday break (see
http://dave.whipp.name/sw/perl6 for the writeup). I was generally
impressed with both the language and its implementation. There were,
unsurprisingly, a bunch of things missing. Some of these were things
that are in the
That doesn't solve the general problem:
my $junc = any -4 .. Inf;
my @domain = -Inf .. 4;
my @values = @domain |==| $junc;
say @values.perl
[ -4 .. 4 ]
How do you code that using grep?
From: Daniel Ruoso dan...@ruoso.com
To: Dave Whipp d
Daniel Ruoso wrote:
my $concrete_value = max $junc_value.grep: { $^score 21 };
In the general case, both the junction and the domain may be infinite:
my @domain = -Inf .. 3;
my $junc = any -4 .. Inf;
my @values = @domain |==| $junc;
say @values.perl
[-4..3]
Handling all the variations
Leon Timmermans wrote:
On Mon, Dec 15, 2008 at 5:43 PM, Richard Hainsworth
rich...@rusrating.ru 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
Carl Mäsak wrote:
Paul ():
I can't find anything in the existing synopses about Blobs.
Probably looking in the wrong place, sorry.
http://perlcabal.org/syn/S02.html#line_912
Re-reading that, a slightly tangent (though still on topic, I hope)
thought come to mind. The definition of the
Brandon S. Allbery KF8NH wrote:
Still misunderstanding, I think. Yes, it will fail anyway, but in the
general case you're checking to see if as a privileged process it is
safe to operate on a given file.
I'd actually been thinking that one would use the check in the opposite
direction:
The restriction of chown to the superuser is a property of the OS, not the
files. The example from the pod is:
use POSIX qw(sysconf _PC_CHOWN_RESTRICTED);
my $can_chown_giveaway = not sysconf(_PC_CHOWN_RESTRICTED);
Thinking about it, perhaps that means that it's a method on $*OS.
The use of
Larry Wall wrote:
On Fri, Nov 21, 2008 at 11:46:48AM -0800, dpuu wrote:
: before I attempt to change the POD, would this wording be appropriate?
It's a good first whack, though we might want to think about making
it a little less P5ish/Unixish in changing a list of files, and rely
instead of
Jon Lang wrote:
So you're suggesting that
A op* n
should map to
[op] A xx n
I don't think that that mapping works for Thomas' proposal of a
repetition count on post-increment operator. I.e.
$a ++* 3
is not the same as
[++] $a xx 3
(which I think is a syntax error)
and also
Larry Wall wrote:
On Wed, Jun 04, 2008 at 10:42:33AM -0400, Mark J. Reed wrote:
: However, I think we are now officially *way* off topic for Perl6...
Not really--a Klingon army is a *parallel* processor, and just because
one Klingon dies doesn't mean the whole army should suddenly die too.
TSa wrote:
class Length
{
has Num $.mm is rw = 0;
method inch
{
yield $inch = $.mm * 25.4;
self.mm = $inch / 25.4;
}
}
Would you regard that as elegant?
That looks functionally incorrect to my eyes: if the caller resumes at
the time
TSa wrote:
TSa wrote:
class Length
{
has Num $.mm is rw = 0;
method inch
{
yield $inch = $.mm * 25.4;
self.mm = $inch / 25.4;
}
}
Would you regard that as elegant?
That looks functionally incorrect to my eyes: if the caller resumes
Brandon S. Allbery KF8NH wrote:
But there *is* some commonality there, to the extent that both are
motion. This is the kind of thing that spawned this discussion, in
fact: if what matters is motion, there is no reason *not* to substitute
one for the other.
{ draw $gun }: makes a big
Mark J. Reed wrote:
So eseentially,
given (@foo)
means the same as Perl5
for ([EMAIL PROTECTED])
Just wondering: should given @foo {...} alias to $_, or @_?
Smylers wrote:
Dave Whipp writes:
So eseentially,
given (@foo)
means the same as Perl5
for ([EMAIL PROTECTED])
Just wondering: should given @foo {...} alias to $_, or @_?
I'd expect it to alias to C$_, on the grounds that everything always
aliases to C$_.
What's the argument
Mark J. Reed wrote:
The topic should always be $_ unless explicitly requested differently
via the arrow.
Now in the case of for, it might be nice if @_ bound to the entire
collection being iterated over (if any)...
As a perl5-ism:
sub foo { say @_; }
...
given (@bar) {
when ... { foo }
I noted Jonathan Worthington's work implementing the handles trait for
delegation through attributes, and was a bit surprised to see that it is
defined (S12/delegation) to use strings instead of method signatures --
I had thought that perl6 was attempting to be symbolic in places where
perl5
Matthew Walton wrote:
I wouldn't agree with that at all. I think of arrays as ordered constructs,
so I'd want the default iteration over my array to happen in the order of
the indices.
I guess that depends on whether you think of the array as a list or as a
ram. I know that a group at
S06 says that we need to say eager if (@in === @out). So:
@data == eager map { $^x + 1 } == @data.
Is it possible to modify a feed operator using the assignment
meta-operator described in S02 and, if so, is the eager implict?
@data === map { $_ + 1 };
Luke Palmer wrote:
forall was about concurrency, not order of evaluation. There is a difference
between running in an arbitrary order serially and running in parallel.
for %bag {
.say;
}
If the bag had elements hello, world, I think printing:
helworld
lo
Would
Mark J. Reed wrote:
Am I the only one having bad flashbacks to Occam, here? (Transputing Will
Change Everything!)
My $0.02, FWIW:
Concurrency is surprising. Humans don't think that way. And programs
aren't written that way - any program represented as a byte stream is
inherently sequential
Larry Wall wrote:
It's really, really easy to misdesign a computer language by
overemphasizing one particular design dimension to the detriment
of others.
I agree that adding a parallel forall (and similar statements) via a
pragma will be easy if the appropriate underlying machinery is
Larry Wall wrote:
my hope is that we can delegate locking entirely to the innards of
the implementation and never mention it at all on the language level.
Hmm, sounds to me analogous to hoping that type inference will avoid the
need to expose type-annotations at the language level
I was reading Synopsis 4 with regards to multi core programming. It
seems to be infused with a bias towards non-parallel models of
computation. Concurrently appears to be an add-on feature -- whereas we
should have a mindset that explicit sequential constraints are the
add-on feature.
Two
Larry Wall wrote:
As for the Q base form, it's not really there so much for end-use,
For an operator not intended for end use, it has a remarkable low
Huffman rank...
Chas. Owens wrote:
On Dec 21, 2007 4:51 PM, Dave Whipp [EMAIL PROTECTED] wrote:
Larry Wall wrote:
As for the Q base form, it's not really there so much for end-use,
For an operator not intended for end use, it has a remarkable low
Huffman rank...
But since it will be combined with adverbs
cdumont wrote:
By listening to you all, we shouldn't even think to implement file access...
I think I'd argue that most file-access features should indeed be
considered non-core. This doesn't mean that we shouldn't think to
implement them -- or that they wouldn't be part of almost every Perl-6
cdumont wrote:
By listening to you all, we shouldn't even think to implement file access...
I think I'd argue that most file-access features should indeed be
considered non-core. This doesn't mean that we shouldn't think to
implement them -- or that they wouldn't be part of almost every Perl-6
Darren Duncan wrote:
Given this, there is an obvious (to me) solution for pod blocks in the
middle of expressions like:
my $foo
= $bar;
As the example shows, and I believe best practices espouse, you *indent*
the code line with a leading =.
I'd agree that indentation is good for
Jonathan Lang wrote:
Close. I'm thinking added functionality for semicolon alternatives
rather than the replace the semicolon stunt that Semi::Semicolons
pulls. In particular, as long as there's no ambiguity between
prefix:? and postfix:?, I think that it would be quite useful for
postfix:?
I was wondering about the semantics of coercion of non-numbers, so I
experimented with the interactive Pugs on feather:
pugs +42
42.0
pugs +x42
0.0
I assume that pugs is assuming no fail in the interactive environment.
However, Is 0.0 the correct answer, or should it be one of undef, or
NaN?
Doug McNutt wrote:
At 00:32 + 1/23/07, Smylers wrote:
% perl -wle 'print 99 / 2'
49.5
I would expect the line to return 49 because you surely meant integer
division. Perl 5 just doesn't have a user-available type integer.
I'd find that somewhat unhelpful. Especially on a one-liner,
Synopsys 13 mentions an is commutative trait in its discussion of
operator overloading syntax:
Binary operators may be declared as commutative:
multi sub infix:+ (Us $us, Them $them) is commutative {
myadd($us,$them) }
A few questions:
Is this restricted to only binary
Darren Duncan wrote:
For example, the extra space of putting them aside will let us expand
them to make them more thorough, such as dealing well with exact vs
inexact, fixed vs infinite length, fuzzy or interval based vs not,
caring about sigfigs or not, real vs complex vs quaternon, etc.
I
Damian Conway wrote:
Delimited blocks are bounded by C=begin and C=end markers...
...Typenames that are entirely lowercase (for example: C=begin
head1) or entirely uppercase (for example: C=begin SYNOPSIS)
are reserved.
I'm not a great fan of this concept of reservation when there is no
Smylers wrote:
use strict;
That's different: it's _you_ that's forbidding things that are otherwise
legal in your code; you can choose whether to do it or not.
Which suggests that the people wanting to specify the restrictions are
actually asking for a way to specify additional strictures
Jonathan Lang wrote:
Before we start talking about how such a thing might be implemented,
I'd like to see a solid argument in favor of implementing it at all.
What benefit can be derived by letting a module specify additional
strictures for its users? Ditto for a role placing restrictions on
Jonathan Lang wrote:
Dave Whipp wrote:
Or we could view it purely in terms of the design of the core strict
and warnings modules: is it better to implement them as centralised
rulesets, or as a distributed mechanism by which core modules can
register module-specific strictures/warnings
Aaron Sherman wrote:
It seems to me that there are three core attributes, each of which has
two states:
Mutability: true, false
Laziness: true, false
Ordered: true, false
I think there's a 4th: exclusivity: whether or not duplicate elements
are permitted/exposed (i.e. the
David Green wrote:
No, look at the example I've been using. Two arrays (1, 2, [EMAIL PROTECTED]) and (1,
2, [EMAIL PROTECTED]) clearly have different (unevaluated) contents. eqv only tells
me whether they have the same value (when @x and @y are evaluated).
That's a different question --
Darren Duncan wrote:
Assuming that all elements of $a and $b are themselves immutable to all
levels of recursion, === then does a full deep copy like eqv. If at any
level we get a mutable object, then at that point it turns into =:= (a
trivial case) and stops.
( 1, 2.0, 3 ) === ( 1,2,3 )
Audrey Tang wrote:
Hm, Perl 6 actually has two different ways of putting Capture to some
Code object... Following yesterday's P6AST draft I'll call them Call and
Apply respectively:
moose($obj: 1, 2); # this is Call
moose.($obj: 1, 2); # this is Apply
elk(named =
Reading about capture objects, I see that they represent an arglist, and
the the object to which you going to send those args. What is doesn't
capture is the method name (the verb) that's being called. This feels
like a slightly strange ommission.
Compare:
$message = Shape::draw.prebind(
Ruud H.G. van Tol wrote:
Perl6 could introduce (lexical, nestable) comment scope.
In P5 I often us q{...} in void context -- P6 seems to be attaching tags
to the quote operator, so q:comment{...} might fall out naturally.
Larry Wall wrote:
But that's just my current mental model, which history has shown
is subject to random tweakage. And maybe env $+result could be a
special squinting construct that does create-unless-already-created.
Doesn't feel terribly clean to me though. If we stick with the +
twigil
(from p6i)
Larry Wall wrote:
On Thu, Feb 02, 2006 at 07:12:08PM +0100, Leopold Toetsch wrote:
: ... Anyway,
: the P6 model of state is more like a persistent lexical than like
: C's static.
:
: Sorry for my dumb question - what's the difference then? (Besides that C
: dosn't have closures
Today I wrote some perl5 code for the umpteenth time. Basically:
for( my $i=0; $i $#ARGV; $i++ )
{
next unless $ARGV[$i] eq -f;
$i++;
$ARGV[$i] = absolute_filename $ARGV[$i];
}
chdir foo;
exec bar, @ARGV;
I'm trying to work out if there's a clever perl6 way to write
Luke Palmer wrote:
On 1/13/06, Dave Whipp [EMAIL PROTECTED] wrote:
Would this actually work, or would it stop at the first elem that
doesn't match (-f, ::Item)?
If by stop you mean die, yes it would stop.
not what I wanted :-(
Is there some way to associate alternate codeblocks
(perhaps this discussion belongs on p6l)
It sure does;)
(this reply moved to p6l)
[EMAIL PROTECTED] wrote:
Dave Whipp wrote:
An Int is Enumerable: each value that is an Int has well defined succ
and pred values. Conversely, a Real does not -- and so arguably should
not support
Rob Kinyon wrote:
I wouldn't see a problem with defining a Real role that has a fairly
sparse set of operations. Afterall, a type that does support ++ and --
(e.g. Int, Num) could easily does Enumerable if it wants to declare
that it supports them.
What about the scripty-doo side of Perl6?
Darren Duncan wrote:
As an addendum to what I said before ...
...
I would want the set operations for tuples to be like that, but the
example code that Luke and I expressed already, with maps and greps etc,
seems to smack too much of telling Perl how to do the job.
I don't want to have to
1 - 100 of 238 matches
Mail list logo