without making
anything ambiguous. The expression at its right side should not have
whitespace in it. If it does have whitespace, [] or {} is needed to
disambiguate.
Juerd
Austin Hastings skribis 2004-09-24 12:05 (-0400):
Actually, that raises a good point: Should 3 foo convert to number 3,
or should it convert to C3 but remainder( foo) ?
Would the remainder then be dropped when the numeric value changes?
Juerd
Michele Dondi skribis 2004-09-30 10:30 (+0200):
PS: this is something that I'd like in the substitution part of a s///e
operator in Perl5 too: do you know actual code in which $_ was really used
there?
s/\Q$_/$foo{$_}/g for keys %foo;
Juerd
it can be useful.
And is there a way to name something that is anonymous? For example,
naming an anonymous subroutine can help when debugging. In Perl 5,
this is possible with Sub::Name.
Juerd
Larry Wall skribis 2004-11-06 13:32 (-0800):
On Sat, Nov 06, 2004 at 09:17:03PM +0100, Juerd wrote:
: Which things can either have a name or be anonymous?
(...)
Lists (Lazy and Eager)
If lists can be named, then is there still any difference between array
and list, except for automatic (de
.
Juerd
then, that's obvious.
$thingy.errorthingy
:)
Juerd
.
If PERL 5 is open source, could you send me a copy? I know about Perl,
and use perl every day, but I think I read somewhere that PERL is better
for CGI programming.
:)
See also perlfaq1.
Regards,
Juerd
Thomas Seiler skribis 2004-11-25 14:52 (+0100):
Is $heredoc = «END; the same as $heredoc = END; ?
I certainly hope not.
Quoting the delimiter is needed, by the way.
How is 'END' disambiguated from 'qw' list, anyway?
Regards,
Juerd
using q as the first element in a qw-list will
hurt?
I hope the first answer is 'no' and all other questions are thus
rendered irrelevant. Not that I think getting rid of alphanumeric
delimiters is a good idea, though. I just fear complex parsing and
seemingly random syntax errors.
Juerd
that happens to have two vectorizing symbols)?
One last question for now: how hard will it be to implement a grammar
with certain not otherwise specified language features *removed*?
Juerd
? Or did I
misinterpret the answer re mixing them?
my macro circumfix:« » is gone;
Perhaps is gone is a bit too easy for something that shouldn't be
done.
Juerd
] (where z is a defined adverb that does something useful to
the return value, but has no side effects) and mistypes it as
qq:x[$foo]. Instant hard-to-spot security danger.
Juerd
, that's what we have mutable grammar
for.
For that matter, if we stick to declaration syntax for declarations, and
not BEGIN blocks and reflection
Macros are somewhat like BEGIN blocks and may be needed to turn invalid
syntax into something that is valid.
Juerd
'}{$foo}[0]{$bar}
as
%hash`foo`bar`$foo`0`$bar
still works very well for me. At least on all keyboards that I own, it
is easier to type. And in all fonts that I use for terminals (that'd be
only misc-fixed and 80x24 text terminals), it improves legibility too.
Juerd
{} can't be used. This
means Perl can easily disambiguate.
Only for types that have both [] and {}, there is a problem. When they
are both possible, just define one to have precedence. I'd pick {}.
Exactly the same rule should apply for autovivification: {}.
Juerd
. (Frankly, '' is just too hard to
type and be parsed by a human.) It also makes all other balanced
delimiter matching rules more readable:
rx/ \[ \w+ \] /
rx/ '[' \w+ ']' /
rx/ '[' \w+ ']' /
Juerd
saying Leaving aside the use of C`` as a term
And that use of backticks is what this subthread appears to be
about. As I interpret it, backsticks for qx, unless elsewhere declared
gone, are still there.
Juerd
this is a perl5qx`'
For oneliners, I think I'd appreciate using -o for that. The module
itself can be Perl::OneLiner. Things the module could do:
* introduce `` and qx
* disable the default strict
* enable warnings for things like open, print, close
* introduce shortcuts like mv, cp, cd
Juerd
Matt Fowles skribis 2004-11-29 22:22 (-0500):
Juerd suggested scrapping qx and qw in favor of qq:x and qq:w, which
Larry liked.
Credit for this shouldn't be mine, but Larry's, as it's his invention:
[EMAIL PROTECTED]
Juerd
a HASH subscript.
No expressions, but a simple atomic scalar variable should be allowed,
as is true for methods too:
$foo.bar
$foo.$bar
Re spaces, I don't see any reason to disallow them on either side.
They're allowed around . too.
Juerd
Larry's
rejection of the idea.
True. There are however some things that almost everything does not
include, and evidently there is still the need for some to discuss this
subject.
Juerd
Jim Cromie skribis 2004-11-30 16:53 (-0700):
my @args = @{$template{args}};
my $body = $template{body};
eval sub qq:i{
my ($self, @args) = @_;
$body;
}
Please explain what you want it to do with @args there.
Juerd
of interpolating an
undefined value, but with s/undefined variable/empty list/.
Because I'm sure it should be wrong to create empty circumfix operators.
You have to admit that zero width circumfix operators would be VERY NEAT.
Juerd
Matthew Walton skribis 2004-12-01 10:11 (+):
Well that depends... are you intending to write programs, or drive the
world insane?
Yes.
Juerd
people will
still write setters and getters.
Would it be Perl if it dictated any of these approaches?
Juerd
:
will STORE { $foo.set_bar($_) }
will FETCH { $foo.get_bar };
$quux = 1;
Juerd
Juerd skribis 2004-12-03 21:09 (+0100):
$foo.bar .= foo
Meant ~= there.
Juerd
Richard Proctor skribis 2004-12-03 21:27 (+):
How equivalent are and «?
This question has already been asked. See message
[EMAIL PROTECTED].
Juerd
What happens to the flip flop operator? Will .. in scalar context remain
the same? What comes in place of ...? (An adverb?)
Juerd
variable's scope
is, and for the machine because it no longer has to guess whether
something's a typo in order to warn you (used only once is not always
a typo).
Juerd
James Mastros skribis 2004-12-19 23:00 (+0100):
Juerd wrote:
Just typing my before the first use of a variable isn't hard, and it
makes things much clearer for both the programmer and the machine.
Does this imply that it's now possible to type Cmy @foo[23] = 42;, and
declare @foo
Stéphane Payrard skribis 2005-01-07 21:23 (+0100):
my $s := $subjet;
my $c := $complement;
That's what I wanted to avoid.
Why? Do you expect to use lots of one letter aliases?
I think it's one of the most effective ways to kill readability.
Juerd
until the end of
enclosing block.
What is wrong with { loop my $n = 0; $n 10; ++$n { ... } }? I find
that syntax much easier to read and certainly more clearly indicating
scope.
With loop 0 - $n; ...; ... { ... }, the - is too far away from the
block, imho.
Juerd
Consider:
my $foo of Num where { 0 = $^n 10 };
Is the following also valid?
my $foo where { 0 = $^n 10 };
Or does that have to be like this?
my $foo of Scalar where { 0 = $^n 10 };
And can $_ be used instead of $^n?
Juerd
Luke Palmer skribis 2005-01-28 9:31 (-0700):
And can $_ be used instead of $^n?
Of course it can. You know that.
I do?
Can't say I understand well when a topic is implicitly defined and when
not. It's obvious for for-loops and given, but everything else is
blurry to me.
Juerd
Some questions after reading S04:
Can last/redo be used outside loops? (i.e. with if or given)
Is a bare block still a loop?
Can loop be used as a statement modifier? (say 'y' loop;)
Can OUTER be stacked? ($OUTER::OUTER::_)
TIA.
Juerd
Thank you for your fast and detailed reply.
Larry Wall skribis 2005-01-29 11:08 (-0800):
On Sat, Jan 29, 2005 at 05:59:40PM +0100, Juerd wrote:
: Can last/redo be used outside loops? (i.e. with if or given)
No, though of course what loop means is negotiable. Effectively,
anything
.
If all the lists are too strictly separated, we end up with two very
different Perl 6s: one that exists only in design and one, made by the
internals people, with awful hacks because the design didn't work that
well in practice.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http
}, { .word };
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
?
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
about
pushing some built-in mechanism aside when we want to do something
peculiar.
Agreed. Hence my question about being able to pass a signature as an
argument to a macro.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl
to retrieve its signature is wrong, IMnsHO. Subs
should be called.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
like the idea.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
with
right shift. Unary C~ becomes either C+^ or C~^ or C?^, since a
bitwise NOT is like an exclusive-or against solid ones. Note that C?^
is functionally identical to C!. C?| differs from C|| in that
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http
, because there's a greater chance of succeeding within the time
limit). If the lengths are also equal, it sorts alphabetically, so
that words beginning with the same letter are grouped together.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http
.
And now that (?:) is called [], I think teaching how to just do the
right thing is easy enough.
/^(?:foo|bar|baz)$/
/^ [ foo | bar | baz ] $/
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
$foo eq lc $bar { ... }
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Thomas Sandlaß skribis 2005-02-16 18:35 (+0100):
% with . and .«»
% with .{}
. and . imply {}
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Is ='s LHS still automatically quoted? What are the rules?
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Patrick R. Michaud skribis 2005-02-19 14:53 (-0600):
On Sat, Feb 19, 2005 at 09:10:05PM +0100, Juerd wrote:
Is ='s LHS still automatically quoted? What are the rules?
S02 says that = still autoquotes any bare identifier to its immediate
left, even keywords and macros.
Thanks - I wonder how
+ + + ~ ~ ~
additive+ - ~ +| +^ ~| ~^
Oh. I'm ashamed to admit I hadn't looked at the first column. Sorry.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
by one.
http://dev.perl.org/perl6/synopsis/S01.html
s/html/pod/
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
[EMAIL PROTECTED] * [EMAIL PROTECTED] elements.
I'd then expect
$foo +« @bar
and
$foo + [EMAIL PROTECTED]
to be equivalent (æsthetically, the latter is more pleasing, imo).
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http
?
And for symmetry, can we get 0d and \d for decimal, for those cases
where you want to be explicit?
I think \777 should be chr(777). As should \0d777, should you want to
document that it's really not octal. (Important mostly the first year
after the first release.)
Juerd
--
http://convolution.nl
0o10
0b10
0d10
Note that it isn't strictly *needed*. But if you take necessity to extremes,
0x, 0o and 0b are redundant too.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
, including the single space.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
I hit the wrong macro key, causing the message to be sent to the wrong
mailing list. I'm very sorry; please ignore this thread.
:
method foo
~ returns Footype
~ is good
~ is bad
~ is ugly (
...
) {
...
}
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Larry Wall skribis 2005-03-08 9:42 (-0800):
Maybe we need to work in the linguistic notion of pretends to be
somehow.
If this needs a keyword, I suggest plays :)
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl
of $b is
unknown. If it's an arrayref, @a gets all its elements, but if it's a
normal value, @a gets only one element. That's a problem for general
purpose modules/subs. I guess they could all use @a = [$b], but I find
that ugly.)
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http
representable as classes/roles?
my Str::utf8 $bar = ...;
my Str::latin1 $foo = $bar;
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
with current design
for ~LIST?
My gut prefers that both scalar reverse LIST and ~LIST join LIST on ''.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Juerd skribis 2005-03-12 20:32 (+0100):
My gut prefers that both scalar reverse LIST and ~LIST join LIST on ''.
scalar reverse LIST probably returns an arrayref.
I meant ~reverse LIST, which should probably do ~LIST at some point
instead of join($sep, LIST), for consistency, and my request
as
''.join(@foo)
This is what Python does. It does not make any sense to me, and I can't
wrap my mind around it at all. Ruby-ish @foo.join('') seems more
natural.
Just like with how I prefer $fh.print($text) to $text.print($fh), I
cannot explain WHY this is how my mind works.
Juerd
--
http
%foobar
is really
%foo{'bar'}
and
:foobar
is actually
:foo('bar')
naturally,
:foobar, 'baz'
is
:foo('bar'), 'baz'
but is
reversebar, 'baz'
then
reverse('bar'), 'baz'
? And if that is so, then is
reverse bar, 'baz'
any different?
Juerd
f/%03d %15s/$foo, $bar/;
Of course, this is s///-like in quoting behaviour, so f[][] or f
should work just as well. The RHS is not a string, but parsed as an
expression in list context. If this feels weird, just think of s///e,
where the RHS is also not a string.
Juerd
--
http://convolution.nl
and short as possible. Hello, $name looks natural. Hello,
$person.name looks a little less natural. Any .as(ugliness) makes it
impossible to read and leaves you with code-in-text, which as many
templating languages have already shown can very quickly get very ugly.
Juerd
--
http://convolution.nl
like the amount of typing (with the nested
delimiters: parens and quotes) it requires.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
, it still requires the parens
that I so like to avoid. I could certainly live with a list op as short
as 'as', though!
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
differences aside, I can't help
feeling there is *something* in his argument that might be worth
considering in the context of Perl6, which I can't quite put my
finger onto.
use less :wtdi; # :)
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http
.
Seldom used? Where does this statistic come from?
This said, I don't mind the change, but I will probably be typing
:limit(...) a lot if this does change.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
,
because I'd like to continue using id with databases.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
for Perl poetry too.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Larry Wall skribis 2005-03-15 8:41 (-0800):
On Tue, Mar 15, 2005 at 12:13:52PM +0200, Yuval Kogman wrote:
: On Tue, Mar 15, 2005 at 10:51:57 +0100, Juerd wrote:
: Autrijus suggested indeed or id, of which I like indeed better,
: because I'd like to continue using id with databases
Nicholas Clark skribis 2005-03-15 17:53 (+):
On Tue, Mar 15, 2005 at 05:57:57PM +0100, Juerd wrote:
And re its spelling, that's a very good feature, because it'll slowly
teach me how to spell this word. And when I know how to spell it, I can
use it on IRC without dict(1)ing to see if I
HTML tags can be used as {b:bold}
* Paragraph starting with * is a list
* Paragraph starting with # is comment
* Verbatim paragraphs simply start with pre:
* No support for tables yet
* PodTables
* See http://pugs.kwiki.org/?PodTables
Juerd
--
http://convolution.nl/maak_juerd_blij.html
Rod Adams skribis 2005-03-15 12:44 (-0600):
%x.delete('foo');
if %x.exists('foo') { ... }
Would renaming exists to has or hasa be a good idea, if it does indeed
exist only in method form?
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http
Larry Wall skribis 2005-03-15 11:20 (-0800):
On Tue, Mar 15, 2005 at 07:47:58PM +0100, Juerd wrote:
: Rod Adams skribis 2005-03-15 12:44 (-0600):
: %x.delete('foo');
: if %x.exists('foo') { ... }
: Would renaming exists to has or hasa be a good idea, if it does indeed
: exist only
another operator (that happens to
be the exact same thing in practice).
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
function hidden
in the bowels of the core somewhere.
Doesn't it want to be the method .escaped then? The method could support
all kinds of escaping/encoding.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
¥ 1... - $foo, $i { ... }
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
something that involves adding line noise to documents
intended for human consumption.
yes, yes, yes!
Agreed, though I like *bold*, /italic/, _underline_ and `code` very
much. I'd like an option to enable it.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl
Garrett Goebel skribis 2005-03-17 8:37 (-0600):
Perhaps we should consider making $_ readonly in map and grep?
That's one way to avoid clever tricks. Please let's not.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl
the
shorter list.
my @foo = 1..3;
my @bar = 1..5;
@foo ¥ @bar # = 1 1 2 2 3 3
@foo ¥¥ @bar # = 1 1 2 2 3 3 undef 4 undef 5
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
did long time ago.
It also states what I found important when inventing the syntax: things
to consider when inventing your own syntax for the same feature.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
Brian Ingerson skribis 2005-03-17 11:57 (-0800):
'Tis a pity nobody suggested `tis()`.
That sounds more like a smart match on the topic:
if tis 'foo' { ... }
if $_ ~~ 'foo' { ... }
't = $_,
is = ~~
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl
and variable
strings during runtime.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
on the invocant is
indeed more common, then Huffman will like this. I haven't looked into
possible clashing with subs/multis yet.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
start with a character that isn't
even \w.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
of dwimmery already exists for reverse and would work well
with split (regex or string) too. If slice is added to splice, substr
can just be an alias for slice (or disappear), and slice can call splice
if there's a 4th argument.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl
such that in it, lexical variables are visible).
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
{ } be invalid or meaning
anything other than the proposed nothing.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
. There have been some cases where I
wanted to explicitly state } else { do nothing } to make clear that it
was not a design bug.
However, the very same thing can be done with a simple comment:
} else {
# do nothing
}
And that is exactly what I do.
Juerd
--
http
Deprecated' would export symbols, and because then the
symbols are used from ::, no warning is emited.)
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
by looking at the operator table
in S03 and applying the same logic.
[+] should probably be spelled (+) but that's uglier. Other alternatives
are @+ (but this REALLY says array, while it's for lists) and *+ (hard
to read, but ~^ and ~- have the same problem).
Juerd
--
http://convolution.nl
Juerd skribis 2005-03-28 16:44 (+0200):
splice @foo, $_, 1 given first { @foo[$_] ~~ 15 }, [EMAIL PROTECTED];
@foo [-] 15; # whoa!
Note: unfair comparison. The equal thing would be [-]=.
In fact, this illustrates the problem even better, because to get
@foo [-] 15 without [-], you
.
Of course, [/] is subject to the same discussion as the other thread,
and should perhaps be (/) or */.
Juerd
PS. http://tnx.nl/3689VBOF # consistency gone mad (expires in 1 day)
^1 Yes, I know it can be made more efficient by using the list
reference trick, sub { [EMAIL PROTECTED] }-(LIST).
^2
else in Perl. This consistency makes it easy to learn
and easy to debug when it bites.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
... (Someone translate this for me, please :))
There will certainly be a single topic. The only question is whether .
will ever default to it.
Any defaulting to a variable that isn't $_ practically introduces a
2nd/Nth topic, even if it isn't officially called topic.
Juerd
--
http://convolution.nl
101 - 200 of 653 matches
Mail list logo