new(jaws => "chew", claws => "tenderly comb");
S<12/Roles/"Roles may have attributes"> implies that this kind of thing is
okay in roles. Is there any reason not to allow it as in the above too?
This replaces the need for an explicit BUILD in many cases
gs's problem.
> :-)
Noted. Perhaps it'd be worth foregrounding this feature in the Synopsis? I
was just about to add tests -- but I found they already existed, with
a comment
# These tests are not specified by p6l, But these should be right...
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ession, the
whole thing should become a terminal if. Inconsistent but possibly what
people want.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
s accepting a single scalar and no
arguments?
If so then my and Eric's wishes are answered:
when { $_ > 5 } { ... }
when { .caloric_value > $doctors_orders } { ... }
This isn't implemented in pugs yet, but I guess it can be once this is
clarified.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
In pugs, r7961:
my @pats = /1/, /2/;
say "MATCH" if 1 ~~ any @pats; # MATCH
say "MATCH" if 0 ~~ any @pats; # no match
So far so good. But:
my $junc = any @pats;
say "MATCH" if 1 ~~ $junc; # no match
say "MATCH" if 0 ~~ $j
ht up &flunk as a candidate name. Its merits,
including its, uh, dropout cuteness, are many; it rings well against
fail, alludes to tests, can probably be backported to the Perl 5 test
modules, etc.
What say?
[++]
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
e import directives (that say something about how the
caller sees the module) with other configurations (that say something
about the demands made by the caller to the module).
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
export" trait is just for formal signature matching /
documentation purposes then. What is the scope of this override?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
be to
stipulate an explicit configuration argument. &import can receive it as
a named arg.
use Test::More conf => "no_plan";
Alternatively disallow implicit my importation specs and treat everything
to the right of the module name syntactically as arguments to import,
with the parser picking out things it recognizes as imports and passing
everything else through.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
an interesting
structure containing the relative and actual absolute path of the
resources loaded. (In fact, this is what recent pugs does :).
I know some code does "require 'foo.ini'", but can't that be relegated
to a module and use a different store than %*INC?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
On Fri, Dec 23, 2005 at 02:47:08PM -0500, Peter Schwenn wrote:
> In order to Makefile.PL Pugs, what is the environment variable that
> points to GHC?
It just needs to be in your PATH. Make sure you have version 6.4.1 or a
recent development snapshot.
--
Gaal Yahas <[EMAIL PROTECT
On Fri, Dec 23, 2005 at 11:24:54PM -0500, Peter Schwenn wrote:
> How does Pugs use Parrot "external" as opposed to "embedded"?
Have the parrot executable in your path. Don't have "parrot" in the
PUGS_EMBED environment variable.
(TODO: move over PUGS_EM
in.)
We'll be very happy for contributions on this front. Why don't you join
us on IRC and get commit access?[1]
Alternatively, I'm using coLinux happily.[2]
[1] #perl6 on irc.freenode.org
[2] http://www.colinux.org/
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ugh to do this. For example if a module one wishes to pull in isn't a
Role :)
There are over a hundred "use_ok" in the Pugs test suite; we are about
to work around the problem by changing them to use+pass, but that's
obviously the Wrong Thing. Is there a better workaround
While cleaning up tests for release:
"".split(':')=>
()# Perl 5
("",) # pugs
Which is correct? It doesn's seem to be specced yet.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
have
> foo.___:bar, and $foo.__:bar is clean.
But it doesn't work across lines:
$xyzzy.foo()
$fooz.:foo()
$foo. :foo()
$fa. :foo()
$and_a_long_one_I_still_want_to_align.
:foo()
$etc. :foo()
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
On Sun, Apr 30, 2006 at 07:01:06PM +0200, Juerd wrote:
> Gaal Yahas skribis 2006-04-30 16:05 (+0300):
> > But it doesn't work across lines:
> > $and_a_long_one_I_still_want_to_align.
> > :foo()
>
> Explain to me why it wouldn't work, please.
nking hard enough, so if anyone can come up with an
implementation please give it :) Otherwise, how about we add this to
the language?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
make @input be the last index when used in a
range, or did you mean ..^ ?)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
rs do in list context.
I love this idea and have implemented it in r10246. One question though,
what should a scan for chained ops do?
list [==] 0, 0, 1, 2, 2;
# bool::false?
# (bool::true, bool::true, bool::false, bool::false, bool::false) ?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
sum yields closer and closer approximations
of some value, you can use a scan to efficiently cut off once some
epsilon is reached.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ion they
> return if the condition turns out to be false. Wouldn’t your
> solution evaluate it unconditionally?
That can be solved with an explicit thunk:
sub infix: ($x, $cond) { $cond ?? ($x(),) !! () }; say 1, 2, {3} pv 1, 4
Or maybe 'is lazy' on $x?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
here and we can certainly choose not to attack every problem now.
But yes, let's get the discussion going (thanks, Darren, for starting
this thread) and come up with a plan, so that we can be ambitious and
realistic together.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
g that benefit to other implementations without crippling it
> >for anyone?
>
> From the point of view of a *user* of Perl 6, one that gets it from
> CPAN, getting this to work is just a matter of packing the tests in
> such a way that they can be "installed" so
threw the exception. That is, the
stack is not unwound until some exception handler chooses to
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
%?CONFIG variable which I propose
each implementation support. Pugs says 'pugs'. Also, there's a
%?CONFIG so there's no need to parse $?PUGS_VERSION.
pugs> %?CONFIG{%?CONFIG ~ <_versnum>}
6.2.12
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
v) this week?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ut as far as I can tell they are meant to be built from
> within the Pugs source tree, and since my code clearly won't be living there
> I'd rather not write it there either.
Then at least read there. Good luck :-)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
:($x where {...} is elk)# ambiguous auxillary
Is this legal? does the 'elk' trait pertain to $x or to the where-block?
:($x is ro is rw) # conflicting traits
Is this legal? Is $x ro or rw?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
aragraph and introduce
the optionality of the colon less jarringly.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
I was writing tests for signatures and came across this ambiguity:
:(:$x)
Does this mean a single named parameter called $x, or a default invocant
and a single required positional named $x?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
thing to "default" to. :-)
What invocant is constructed in this signature then?
method foo ($just_a_named_param)
Is the signature for &foo really the same as that of bar?
sub bar ($just_a_named_param)
I was sort of assuming you could tell by a signature if it was f
ransitioning to the new AST,
in which it will be possible to (finally!) implement lexical pragmas,
to which this properly belongs.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
l6/Test.pm line 34, column 21
> t/general/basic.t line 1, column 1)
You have an old version of Test.pm (and likely, other modules too) from
an earlier 'make install'. Better wipe out your /usr/local/lib/perl6
and any other traces.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ck, I think
(Pugs does not yet implement gather/take):
sub flatten1 (@list) {
gather for @list {
take $_;
}
}
sub flatten2 (@list) {
gather for @list {
take $_.does("List") ?? flatten2 $_ !! $_;
}
}
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
a bug.
Perl 6 differentiates between a bare Code and Routine objects. Replacing
"->" with "sub" should get you what you want.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
svn)
You have one now :)
(The darcs mirror used to be one-way; I don't know if this has changed.)
> By the way, any comments on the code? :)
Come over to #perl6 on freenode.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
macro (possibly a
> standard subroutine, I'm not sure) like
>
> testing {
> ok foo;
> }
>
> would it make sense or I'm just crazy?
I like the approach.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
an for take to be evaluated in void context?
What are the gathered values here?
take 1, 2; # easy. flattened 1 and then 2, right?
@x = take 1, 2; # same thing?
$x = take 1, 2; # same thing? [1, 2]?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
On Mon, Jan 29, 2007 at 10:01:08PM +0200, Gaal Yahas wrote:
> > +Because C evaluates its block or statement in void context,
> > +this typically causes the C statement to be evaluated in void
> > +context. However, a C statement that is not in void context
> > +gathers
On Mon, Jan 29, 2007 at 10:08:34PM +0200, Gaal Yahas wrote:
> On Mon, Jan 29, 2007 at 10:01:08PM +0200, Gaal Yahas wrote:
> > > +Because C evaluates its block or statement in void context,
> > > +this typically causes the C statement to be evaluated in void
> > > +co
is entered twice here :-)
(If I'm following correctly, then take's args are basically evaluated
in list context. If YYY is something like "$scalar = " that list gets
Captured, but there's still a list there.)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ygwin tool used in a Cygwin shell; how is it solved there?
[1] See:
http://www.haskell.org/ghc/docs/5.04/html/building/winbuild.html
http://www.reed.edu/~carlislp/ghc6-doc/users_guide/x11221.html
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
it can be ported to p6
already.)
Let's make a list of things that are broken. For me things mostly work:
the test suit does, if I use the yaml harness (p6); 'make test' and
pugscc do not. Do you know of anything else?
Are there other issues besides paths?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
Good idea. A modest start is at docs/quickref/unicode .
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
nt|List to express this kind
of thing but that looks weird to me (how would you return a typed
junction?). S06 and E06 don't raise this issue.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
be able to write Perl6 code with a certain flag that
possibly limits my choice of modules/builtins, but which promises me
identical behavior on all supported platforms?
To take a notorious example, you mentioned fork() -- if this event manager
becomes part of Perl6, does that mean we're re
at it -- the actual runtime parameters (if still available, and
if this doesn't turn out too hard to implement)?
S06's "want" is much simpler than A06's. Can it for now be considered
complete? (I'm asking because A06 links "want" intimately to "caller"
and that appears to no longer be the case.)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
;), as "the third
sub". And unless I'm wrong, caller(Block, :skip<2>, :label) would
mean, "once you get to the third Block, look on for one labeled "moose".
So we don't have a way to skip three methods and then look for a labeled
block, but if the user really wants that, let them grovel over a
complete call chain themselves.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
for a "floor" as 1st arg
method bereaucracy(Int undef, Int $office_number) { ... }
I'm not sure how this works for named fields, but for positional ones
it should do well, and is similar to ($a, undef, $c) = LIST syntax.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
it needs
to be renamed maybe IPC could work.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ct that I don't think this is the right way to
> specify class methods...
What do you think is the right way to specify them?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
quot; if caller().package ~~ Rival;
...
}
Anyone spot any problems?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
lti sub localtime(Int $sec, Int ?$pico = 0) returns Time::Local {...}
The first form uses the second, but might be less precise.
[1]
http://haskell.org/ghc/docs/latest/html/libraries/base/System.Time.html#t%3ACalendarTime
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
st is okay? If so I'll submit a doc patch to S29.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
rt of the language, _or_ localtime & gmtime should be in a library.
Not my call, but I think we can add timelocal and timegm soon. They're
mostly cleverly-caching facades to Time.new anyway, no? Drop by on #perl6
if you want to hack on the Prelude side of this.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ternals),
),
URI.new("http://codeIZus.com/perl/randommodule.cgi";) =>
Module.new(name=> "Acme::emcA", ...),
$an_open_file => ...
);
@*INC = ("/usr/local/lib/perl6",
U
when looking at the
return value of a printed "0" or "" while not using "fatal", but the
code can use a defined guard.)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
to tag a sub as failable? Should there be one?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
aps in light of L, we can make "use" and "no"
activate TURNON and TURNOFF blocks?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ch to Parase::RecDescent somewhere
that fixes that, or you could use Class::Rebless which I wrote initially
because of this problem -- though I ended up doing the blesswork inside
the code sections manually as it made much more algorithmic sense.
Hope this helps.
--
Gaal Yahas
commit feed available somewhere?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
Is the second of these two tests supposed to fail?
my %hash = ( bar => 'baz', quux => 'quuz' );
ok(defined(%hash{"bar"}), "hash subscript");
ok(!defined(%hash{"bargho"}), "non-existent hash subscript") or
diag("expec
in the spec, though.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ot;) ?)
If I do the analogous thing with the symbol table hash, (how) is the
behavior any different? What can you express with ::() but not with the
symtable hash?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
cently too (r818+819 are simple
tests for it).
There's also a weird parsefail on pointy qw for hashes at the bottom of
t/op/hash.t . Now we should hunt for a parsefail in scalars, I guess :)
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
~= (substr $from, $i++, 1);
} while (--$n>0);
return $to;
}
In Pugs at least, labels may only only be assigned to blocks. Any chance
the language gets to have them in more arbitrary places? Would this in
fact be enough to make this work?
--
Gaal Y
>
> Does anyone know the "normal" workaround for this problem?
> (If not, I could ask the perl-qa folks).
As a dirty workaround, look at the SUBST command.
c:
cd \yoursources\perl\pugs\pugs.hack # [ etc. ]
subst p: .
p:
nmake test
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
return a reference to some object instead of an
id?) If the alarm builtin is getting too overloaded, I propose the
closure version be named "later".
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
Either
require everything to be explicit with adverbs, or have the closure's
return value determine whether to keep calling back or to quit. GLib
does the latter, and there's a cleanliness in how the closure itself can
control when to stop, but the former means you can schedule arbitrar
cygpath love and if you're willing to work on that, that's great (I got
sidetracked). Do you have a committer bit? Drop by #perl6 and we'll get
you one if not.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
was to honor a BOM if it is
present but default to ASCII otherwise. Or should we UTF-8 otherwise?
Or what's in the environment...?
And what about IO layers? :)
What else belongs here? dirhandles, sockets? How are they specced? I
was looking for a happy medium between overdwim and underlying library
primitives level.
[1] Should this be "Perl(..5) style"?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
uld exclude
:append)
* computed options (if by "let Perl figure that out" $mode you didn't mean
"let perl's open figure it out with explicit code).
How would you suggest formalizing these?
(By the way, we need a spec for perl's command line, too. So far we
OUT variables (yech)). Should we provide further
procedural interfaces for pipe2 and pipe3?
[1] "Process handle" encapsulates unix pid / win32 process handle.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
solution suffices in a clean way:
>
> $h = open a pipe;
>
> Now,
> $h.in;
> $h.out;
> $h.err;
>
> $h.print("foo"); # use $h.out
> $l = $h.readline; # use $h.in
Yes, if $h is the not-very-primitive version of IO. Surely the
How do I open a file named "-"? How do I open stdout (and the other
standard handles)?
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
e a few options.
What does '"file"' do in these examples? If we take your trailing-args
suggestion from the Open and pipe thread, the filename could be optional.
How to make this "-"-friendly? If my earlier suggestion is okay, then
by symmetry:
$logfile = "-";
open $log, :a:allowstdio;
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote:
> On 5/5/05, Gaal Yahas <[EMAIL PROTECTED]> wrote:
> > getopt(...);
> > $fh = open $in, :allowstdio;
>
> Maybe the opposite:
>
> $fh = open $in, :literal;
>
> One of the nice things
ote, http://perlnomic.org/ .
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
If this is the case, remove your smoke and try again (simply
"make smoke" again should do the trick).
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
ested):
perlReplicate :: VInt -> a -> Eval [a]
perlReplicate (1/0) _ = fail "Infinite replications would exhaust memory"
perlReplicate i a = return $ flip genericReplicate a $ if i < 0
then 0 else a
You'll need to tweak the calling site to be monadic too.
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
cant think of an immediate opposite to 'when', but how about
> although, yet, except, howbeit
>
> Perhaps (less elegant): when not, elided to 'whent'
>
> English doesnt seem to have a word that fits the opposite of
> 'when'
> In other words something
cro qx { 'qq:x ' } # equivalent to P5's qx//
--
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/
On Thu, Jun 19, 2008 at 9:01 AM, Gaal Yahas <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 19, 2008 at 7:45 AM, Gabor Szabo <[EMAIL PROTECTED]> wrote:
>> What replaces backtick or qx{} ?
>
> q:x{}, alternatively spelled qqx{}. From S02:
qq:x, that is of course.
--
Gaal Yah
84 matches
Mail list logo