mation point
(foo.method!), because of the analogy with other mutating operators.
Please excuse me if this or something like this has already been taken
care of - I've searched for messages about it, but haven't found
anything.
Regards,
Juerd
looks like something that
zips.
Regards,
Juerd
of 184 fonts.
Broken pipe for | is too common to use the unicode symbol for this to
mean something else. Even if it weren't, it would still be too similar.
Juerd
ible
to override the builtin, but for a good reason most people choose to not
do that.
Has this C already been decided?
Juerd
really confuse Perl 5 programmers; why
should programmers of languages that aren't even Perl be treated
differently?
Juerd
array?
What is a list?
Regards,
Juerd
nge what already works?
use 5;
no 6;
It could be a special case: not throwing a fatal exception, but instead
changing the grammar to a Perl 5 compatible one.
Juerd
"$foo{"bar"}"
correctly out of the box. I can't even imagine a way to make that look
nice. So let's just have this autoquoting, method-ish `, please. Hashes
are used a lot in Perl and ` is in an extremely easy to type place.
It's a shame to give away that beatiful key to readpipe if you can use
it for hashes instead.
I think %hash`key makes sense. But I'd like to find out if more people
like this idea.
Juerd
inus) and simple scalar variables (the
thing perlreftut calls "atomic") like $foo can be used.
Juerd
Jonathan Scott Duff skribis 2004-04-14 14:21 (-0500):
> On Wed, Apr 14, 2004 at 12:07:18PM -0700, chromatic wrote:
> > On Wed, 2004-04-14 at 05:18, Juerd wrote:
> > > I think %hash`key makes sense. But I'd like to find out if more people
> > > like this idea.
>
y exists.
Yes, it does mean learning the meaning of one more character. I think
every programmer is able to cope with that. Even beginners.
Juerd
John Williams skribis 2004-04-14 13:36 (-0600):
> On Wed, 14 Apr 2004, Juerd wrote:
> > I propose to use ` as a simple hash subscriptor, as an alternative to {}
> > and <<>>. It would only be useable for \w+ keys or perhaps -?\w+.
> > As with methods, a sim
s of their
own. I don't want %hash.keys to be interpreted as
%hash{'keys'} and I do want to be able to use the easier syntax when my
hash does in fact have a key 'keys'.
Juerd
ds. What people expect because they are used to other
programming languages does not matter at all. The language should be
a consistent universe within itself. If THAT it is not, you are
violating the principle of least surprise.
Believe me, any non-Perl-6 coder will be surprised when seeing Perl 6 in
action. And that is a good thing.
Juerd
Randal L. Schwartz skribis 2004-04-14 13:56 (-0700):
> >>>>> "Juerd" == Juerd <[EMAIL PROTECTED]> writes:
> Juerd> readpipe/qx/`` isn't used much. In all my @INC, only a handful of uses
> Juerd> can be found. Most are in Debian's modules.
TED]>, it's not a
question of whether it is possible. I know it is possible. Either by
changing the grammar or perhaps by adding an operator/macro.
And as explained in multiple messages already, implementing this using
the . has too large drawbacks.
Juerd
likely to be a literal than a function call. It seems that that
> is really the source of the entire 'problem' that this thread
> addresses.
No, it only was an extra motivation.
Juerd
would have preferred that Perl 6 used the bash/zsh-style:
> $(...)
It's just one keyword and a set of quotes more: $( readpipe "pwd" )
Juerd
Aaron Sherman skribis 2004-04-15 14:29 (-0400):
> On Wed, 2004-04-14 at 16:56, Juerd wrote:
> > How many of those backticks
> Note, those weren't backticks, those were programs. There were 123
> PROGRAMS that used backticks or equivalent syntax.
I said backticks, and I mean
Code breaks when methods are added.
Option two: keys get precedence
Would have to delay everything until runtime.
No, if we want a simple and lean operator for this, it must not be one
that in the same context also has another function.
Juerd
ttempt at getting balanced quotes in ASCII that involves
` and ', but it shouldn't be a problem as that in normal use always
follows whitespace or at least interpunction.
> On the grounds that personally I hate the backtick :-)
...
Juerd
PROTECTED] I like ` because it's a small but
recognisable glyph. (And because of its location on most keyboards.)
Juerd
e frequently accessing a hash via constant strings, you're
> probably using it like a record. And in Perl 6, that's better spelt as
> $obj.keyval.
Sometimes an object is overkill. I'd say: most of the time.
Juerd
Austin Hastings skribis 2004-04-15 18:38 (-0400):
> $foo % bar
" % " is 4 keys: space, shift, 5, space. Too much, IMHO.
Typability and readability are both VERY important.
Juerd
urns the
>next \w+ into a string) and use the normal hash indexer, {}. I have
>no suggestion for this operator's name, although if you wanted to rip
>out the current unary backticks, it could be a candidate:
>%hash{`key}.
Same as 3, but with another character.
Juerd
Austin Hastings skribis 2004-04-15 19:37 (-0400):
> I'm sure that if Juerd or someone were to write a "PublicHash" class,
> they would cleverly reverse the access so that some collision-unlikely
> path would get the methods.
I'm sure I have explained several times
Sean O'Rourke skribis 2004-04-15 8:55 (-0700):
> [EMAIL PROTECTED] (Juerd) writes:
> > I think it has to go because `pwd`, `hostname`, `wget -O - $url`
> > should not be easier than the purer Perl equivalents and because
> > ``'s interpolation does more harm than
egexes.
We don't need threads.
We don't need lexical variables.
We don't need junctions.
We don't need any dwimmery.
But please, let's write Perl 6 instead of another Java-wannabe.
We don't NEED anything except zeroes and ones.
But all these nice features are damn nice to have!
> I don't really think we need two. All we really need is one way with a
> good enough syntax to meet all of our needs.
Or three syntaxes of which you can choose, depending on what you mean
and like to write.
I thought Perl minded people were used to TIMTOWTDI, but I'm proven
wrong once again.
Juerd
David Wheeler skribis 2004-04-16 9:58 (-0700):
> >for @thingies, qw(blue yellow) xx Inf -> $thingy, $class {
> >print qq[$thingy\n";
> >}
> I think that $class would be C after the second record in
> @thingies, unfortunately.
Even with the "xx Inf"? Why?
Juerd
he better.
Most of those who disagree so far do that they either don't understand
that `` does not have to go, or because they find the ` "ugly".
Fortunately, there are also people who absolutely love the proposed
%foo`bar.
Juerd
y.
Can't we in Perl 6 just use something like this?
for @thingies, qw(blue yellow) xx Inf -> $thingy, $class {
print qq[$thingy\n";
}
Juerd
Larry Wall skribis 2004-04-16 11:50 (-0700):
> On Fri, Apr 16, 2004 at 07:12:44PM +0200, Juerd wrote:
> : Except for the shocking number of closed-minded people on this list.
> You seem to be one of them. From my point of view, you've had your
> ego plastered all over this propos
&stuff(1)
> @stuff[1]
> %stuff{1}
> %stuff«1»
> %stuff`1
Hm...
print if not $foo;
if (not $foo) { print }
print unless $foo;
unless ($foo) { print }
$foo or print;
And there are many more examples in Perl. I personally like having two
ways to write exactly the same thing. If the two ways are very
different and one is because of that much easier than the other, I like
having the alternative even more.
Juerd
y
key >> } with implicit curlies, not as an alternative to curlies.
This is where ` as a bareword-quoter would provide a somewhat consistent
interface, as %hash`key would then just be %hash{`key}, but without the
curlies. And :foo<> and :foo`a would be :foo(<>) and :foo(`a)
without the parens.
But I also like to think that // is m// with implicit m, instead of the
other way around.
Juerd
John Williams skribis 2004-04-16 18:32 (-0600):
> You didn't answer his question, "which is less complicated?"
Wasn't that a rhetociral question?
Juerd
who disagrees is closed-minded.
Instead of asking me to stop interpreting disagreement as
close-mindedness, ask yourself to stop interpreting "closed-minded" as
"disagreeing".
There is no 'between the lines' in my messages. Stop looking for it.
Juerd
Abhijit A. Mahabal skribis 2004-04-19 11:00 (-0500):
> when Dog: ...
> when Array: ...
Shouldn't that be:
when Dog { ... }
when Array { ... }
Or is there some .when that I have not yet heard of?
Juerd
ntirely? I can't return it as an lvalue now, can I?
Why not?
Juerd
ther than very simple ones
(anything containing a / is not a simple string imho) is good for
readability.
Juerd
k there's any ambiguity -- anything ending
> in a '/' is a regex, anything otherwise is a hash slice.
I don't understand. Could you give some examples? Is this in the context
of bare /path/to/foo, even?
Juerd
it's doable, and even "if -r /etc/passwd" is doable, but there
are too many allowed characters in filenames (on my system: any
character except \0 and /).
Juerd
We could maybe even treat hashes and arrays as list operators. That
would allow whitespace, and also:
@array 15
But I liked about the backtick that it's special syntax, which makes it
recognisable. Still, your idea is doable.
Juerd
t; x $^v;
> }
> { +$.buffer.bytes }
Could this be written as:
method buffersize {
+$.buffer.bytes
} will store {
my $sqrt = $^v.sqrt;
...
}
Or does "will store BLOCK" really have to go before the main block?
Juerd
27;t like other uses of underscores for
important things in the core language.
> On the sixth hand, by that argument, since .dispatcher is aiming at
> a Class, it should be an uppercase C<>. :-)
Doesn't unicode have that, then? :)
Juerd
quot;my Class $spot = Dog" then? Or maybe
just "my $spot := Dog"?
> This is, as pointed out, just sugar for Dog::new and Dog::list_breeds, but
> it brings up the spectre of undef invocants:
:: or .? I'm confused.
> $c->foo->bar->baz; # If foo or bar fails, what happens?
-> or .? Even more confused now.
Juerd
hate to have to specify stdin and stdout in throw away scripts.
> }
I think I like this better:
for <> {
s:g/\w+/WORD/;
print;
}
But I think I still want to have some non-mutating version of s/// that
returns the modified string, so that you can just write something like
print s:gx/\w+/WORD/ for <>;
Juerd
Juerd skribis 2004-05-12 20:15 (+0200):
> But I think I still want to have some non-mutating version of s/// that
> returns the modified string, so that you can just write something like
> print s:gx/\w+/WORD/ for <>;
Actually, can't we just use the . for s///?
You
Larry Wall skribis 2004-05-12 11:39 (-0700):
> On Wed, May 12, 2004 at 08:15:36PM +0200, Juerd wrote:
> : A2 says $*STDIN and $*STDOUT. Has this been changed?
> It's $*IN and $*OUT.
I like this change!
> : I'd hate to have to specify stdin and stdout in throw away scripts.
27;d like to be able[1] to write
my $n = new IO::Socket::INET :LocalPort 20010 :Listen 5;
But unfortunately, parens are not optional with :pairs.
Juerd
[1] Because I'd use something like that in other contexts. I expect that
I will not use indirect object syntax even in Perl 6 and will in r
Aaron Sherman skribis 2004-05-12 17:30 (-0400):
> I like C<...> I like it a LOT. In fact, I'm partial to the idea that
> it should be usable anywhere
I agree. It'd make even more of my pseudo code (#perlhelp and
perlmonks.org) valid syntax :).
Juerd
nd s:modifiers.
> #!/usr/bin/perl =
> #!/usr/bin/perl =6
Feels like something is missing. Like a LHS.
I like - for command line switches.
Juerd
What's wrong with just specifying them as positional ones? Don't
document the feature and you'll effectively have required named
parameters.
Or am I missing something?
> "the entire P6 grammar"
Are parts already available in Perl 6 rule syntax?
Juerd
ound kind of attractive to me, because it's a bit like
lc $a eq lc $b
Juerd
ay.histogram.keys. But
again, just having a method for that is probably a better idea (if only
because with the hash, the original order is lost).
Juerd
+ for @foo; }, i
b => sub { my %foo; $_++ for @[EMAIL PROTECTED]; } }'
Rate a b
a 51121/s -- -9%
b 56220/s 10% --
Juerd
'2' => 2,
'1' => 2,
'16' => 1,
'13' => 1,
'6' => 2,
'3' => 2,
'9' => 2,
'12' => 1,
'14' => 1,
'15' => 1,
'8' => 2,
'4' => 2,
'10' => 2,
'5' => 2
};
This is perl, v5.8.4 built for i386-linux-thread-multi
Juerd
dem lines, you can afford to download it each
time you start it: http://startputty.com/ - if you trust them.
Juerd
ternative, more
# switch-like pair constructor
Juerd
argument, without repeating any
part of the existing signature? Like:
&*foo.wrap sub (&*foo.signature, +$new_thingy) {
# or whatever syntax
...
call;
}
Or is the original signature not usable, and does one need to consult
the manual/source and copy it?
Juerd
or
one, would like "return true;" (where "true" is undef-ish: a keyword
that always returns the same value).
Juerd
biguity?
A circumfix ++ operator won't work for several reasons. What will Perl
do if you try defining one?
Please don't say that picking a random sequence of at least 5 different
unicode dingbats will be the best way to be sure :)
Juerd
ard to get used to. Perhaps I'll try to
make it easier (and thus harder in the longer term) for myself by
defining something that does .isa('Str') ? .chars : .isa('str') ? .bytes
: .isa('Hash') ? .keys : .isa('Array') ? .elements : 1.
Synopsis 6 describes 'str' as 'native string'. Is my assumption that
such a string is one that doesn't have multi-byte characters correct?
Juerd
ry one of these three can be
overriden.
And actually, I don't think I understand it correctly. It's been a while
since I had a feeling of understanding Perl 6 :)
Is this complexity really needed?
Juerd
Austin Hastings skribis 2004-06-24 15:54 (-0700):
> I'd say yeah, it is. 0-but-true is pretty nice to have. (Finally the
> system calls can return something other than -1.)
That we already have. "0 but true". (perldoc -f fcntl)
It's 1 but false that's really special :)
Juerd
6 is very neat, but try to appreciate what Perl 5 can do. It's not
a stupid, old language now that Perl 6 is being designed. It is still
the powerful programming language with lots of quirks and handy
exceptions.
Juerd
nd $b for 1..3;
Or, with just one statement modifier, as "if" is just a fancy "and" (or
vice versa):
$a and $b and print $a + $b for 1..3;
Juerd
written as:
say .{foo} for @<<@foo; # Looks strange. Is this correct?
Juerd
Dave Whipp skribis 2004-06-28 9:55 (-0700):
> > substr($string, 2 bytes, 4 bytes) = $substitute;
> substr($string, 2, 4 :bytes)
substr($string, 2 but graphemes, 4 but bytes);
I think "but" even makes sense, if substr defaults to something.
Juerd
Mark A. Biggar skribis 2004-06-29 9:07 (-0700):
> Besides we already have MTOWTDI with local() and hypotheticals.
I thought temp replaced local. If not, how do they differ? (is temp for
lexicals, local for globals (and why would that make sense?))
Juerd
, the string in array/list context can default to
the default set by a lexical pragma. Which, I hope, has a default
itself. (I like default defaults...)
Juerd
Scott Bronson skribis 2004-07-01 12:42 (-0700):
> But C<;> requires a surrounding do block, as you noted.
Then invent a horizontal ; operator that does not :)
>pray_to $_ then sacrifice <$virgin> for @evil_gods
pray_to $_ ., then sacrifice <$virgin> for @evil_gods;
Juerd
ld work alone, couldn't it?
It is a horizontal ;.
See: .,
If you turn your head 90 degrees counter clockwise, you see the
horizontal semicolon and even a smiley face :)
Juerd
Scott Bronson skribis 2004-07-01 14:11 (-0700):
> On Thu, 2004-07-01 at 13:35, Juerd wrote:
> > > > pray_to $_ ., then sacrifice <$virgin> for @evil_gods;
I meant it without "then", but apparently forgot to remove it.
pray to $_ ., sacrifice <$virgin> for
ctangle.) will in my programs probably only be
used through infix:Y or infix:z, which I will define myself if
necessary. (zip() is not infix and thus not an *equivalent*
alternative.)
Juerd
array
subscripting.
Accessing strings as if they are arrays was discussed recently. Please
read the archives. (groups.google.com is my favourite interface)
Juerd
g, even.
I think "then" as an infix operator is the way to go, if comma really
won't allow us to write this. "then" as a method my brain won't grok.
Juerd
s to add sugar without abusing things that normally mean
something else.
Juerd
be a method of Object that uses
self.postcircumfix:{}.)
Perhaps by making this popular, we can get rid of AUTOLOAD junkies ;)
Juerd
Simon Cozens skribis 2004-07-12 12:58 (+0100):
> [EMAIL PROTECTED] (Juerd) writes:
> > Could methods like "[]" and "{}" *default* to "postcircumfix:"?
> A more interesting question is "does it mean anything for them *not* to be
> postcircumfix&q
characters, and especially
combined mode and filename in one argument.
Ever since I read about the new :pairs, I thought that would imply :rw
instead of >.
Juerd
l globs?
perl -le'print for glob "{1,2,3},{4,5,6}"'
Juerd
ct that you want to both read and write a file says nothing
> about whether you initially want to use, clobber, or append to an
> existing file.
It's okay to have defaults, I think.
r use
w clobber
a append
rw use
This can without too much trouble be solved with :append and :clobber.
Juerd
using different layers for in and output easy:
open :r('iso-8859-15') :w('utf8'), $file;
although you shouldn't want that :)
Juerd
# IIRC, rules also let you combine
# single-letter modifiers
> open FH, "/usr/bin/foo|";
open :w :p, ...;
And open2 is :r :w :p or :rwp or :read :write :pipe.
Or something like that.
Juerd
e/path
in one argument.
[EMAIL PROTECTED]:~/tmp/example$ ls -R *
|:
usr
|/usr:
bin
|/usr/bin:
foo
Juerd
If an array element knows that it is an array element, this can be
useful:
for @foo { push @bar, .splice if EXPR }
Juerd
Dave Mitchell skribis 2004-07-17 18:24 (+0100):
> On Sat, Jul 17, 2004 at 06:53:28PM +0200, Juerd wrote:
> > If an array element knows that it is an array element, this can be
> > useful:
> > for @foo { push @bar, .splice if EXPR }
> What happens if the element is an
Do we have a :) operator yet?
Juerd
quot;$( $file ).ext"". Or maybe "$«file».ext"
> by analogy with "%foo«bar»". James Mastros pointed out that "." is
> rather ambiguous in a literal string; sometimes a full stop is just a
> full stop.
My preference is "$file\.ext". Clear, light and ascii.
Juerd
, make it SIMPLE. Allowing
@foo[1], but not @foo is not simple.
In fact, with {}, is anything more than $foo and {} needed? Is $foo
needed, even (I'd like to have it, because I dislike brackets
everywhere)?
Juerd
s hard to read,
hard to learn and probably harder to parse. Why fix this with regexes
and then reintroduce it in interpolation?
Juerd
nto the
format string, the rest of that string becomes bizarrely unreadable.
Juerd
ligent enough to dwim? Then I can even
*copy and paste* the new operators in this terminal and have it dwym.)
Juerd
$self->{$name}} : $self->{$name}->[0];
> my $string = join "," => @array;
my $string = join "," <== @array;
It's a 180, but it'll workforme.
Juerd
{ ... }
for %quux.kv <-> $key, $value { ... }
to mean
for zip(@foos, @bars, @xyzzies) -> $foo is rw, $bar is rw, $xyzzy is rw { ... }
for %quux.kv -> $key is rw, $value is rw { ... }
Comments, anyone?
Juerd
scalar sub truth
match if $x($_)
I haven't thought of a solution for non-verbatim cells yet. I'm not
convinced that they are needed.
Juerd
ably be seen as one
thing, with one of them being the other's specialized form.
> It's really sick
Sick would be if <- were introduced to make the variable write-only ;)
W R
@foos -> $foo
@foos <-> $foo
@foos <- $foo
It would be consistent, though...
Juerd
e there is no Baz::Blah::new
Perhaps something must be added to tell it *when* to load modules:
at runtime or during compilation.
It shouldn't be hard to implement this module yourself, should it not go
into the standard distribution.
Juerd
on of $bar and $xyzzy, optionally
blah blah blah...
Having {} instead of <> would also please me. Especially if we can get
{b:foo} instead of B.
But I haven't really given this much thought. That's why I haven't
proposed it yet. But since POD is a hot topic now anyway, let's see what
everyone thinks about this.
Juerd
.mouth.open;
.head.extend;
.mouth.close $strength;
}
}
Juerd
1 - 100 of 712 matches
Mail list logo