with characters
reversed?
Smylers
Aaron Sherman wrote:
On Sat, 2002-09-07 at 14:22, Smylers wrote:
Should that C+ be there? I would expect chomp only to remove a
single line-break.
Note that this is in paragraph (e.g. C$/='') mode
Ah, yes. I quoted the wrong case above. The final branch deals with
the case
to?
I'm posting this with a newsreader rather than a web-browser so
hopefully it'll get through. Apologies to anybody who got it twice.
http://groups.google.co.uk/groups?hl=enie=UTF-8oe=UTF-8threadm=d7c367d5.0209051022.9ba6bea%40posting.google.comrnum=1
Smylers
thinking is
what Damian said above.
Option 1 strikes me as unlikely; Damian obviously has read 'A4'.
Option 3 is what scares me and is the reason why I'm after
clarification.
Given that, Option 2 would be a relief. (An embarrassment, but still a
relief.)
Smylers
_per se_, just the
semicolon there compared to the lack of one elsewhere).
and I think otherwise there's too many ambiguities like this one.
However, if an elegant solution has been (or is going to be) found,
I'm all ears.
Smylers
symbols in both places.
Smylers
.
Smylers
, and anybody
actually concerned about this can always use:
$num = massive.length;
So perhaps this isn't a problem.
Smylers
else would
require an extra set of brackets:
my foo = [[1, 3, 5, 7]];
That isn't too bad: the doubled brackets provide a visual clue that
there's two dimensions in the array.
This still seems a bit far-fetched to me, but I don't yet like it less
than the other options ...
Smylers
Aaron Sherman wrote:
On Sat, 2002-09-21 at 06:38, Smylers wrote:
... lists now use square brackets.
I don't disagree that this is a good thing, but let's look at some
cases that might not look the way you had intended: Snip
Oh, I hadn't really intending anything. Starting from what
Luke Palmer wrote:
On 21 Sep 2002, Smylers wrote:
But because C$num _might_ be used as an array ref, the data has to
be kept around, which is wasteful.
The programmer should know whether it would or wouldn't,
Oh, I wasn't doubting that. I was just concerned that if the 'typical'
way
Paul Johnson wrote:
On Sat, Sep 21, 2002 at 10:05:50AM -, Smylers wrote:
Many Perl programs use C$_ to mean
'the current line'. 'A2' gives the Perl 6 syntax for this as:
while $STDIN {
Maybe somewhere in the middle of
it, it's necessary to have a Cfor loop iterating
these two do:
my $x = ARGS;
my ($y) = ARGS;
Parens just grouping suggests that C$x and C$y should be the same
(which may well be good, as it's a subtle distinction which trips up
many beginners in Perl 5). If so, what's the preferred way of getting
the 'other' behaviour?
Smylers
. That's an awkward special-case to have to introduce.
Though thinking about this more, it may not be too much of a problem. A
main use of this in Perl 5 is with C_. Since Perl 6 will have named
sub params this will be much less common and may not be something to
worry about.
Smylers
# bitwise and
$x ~| $y # bitwise or
~!$x # bitwise not
Smylers
a ^~^ b
The first of those contains a tripled operator (the thing I was trying
to avoid when I started this suggestion).
And both of them run the risk of looking like they're underlining
whatever's on the line above rather than being operators ...
Smylers
that this could become a source of confusion.
I actually like the suggestion. Also, I'm seriously hoping never to do
any bitwise stuff in Perl 6, so I'm not objecting to it.
Smylers
Mark J. Reed wrote:
On 2002-10-17 at 22:52:49, Smylers wrote:
... I initially misread the bar as an exclamation mark. I realize
that this is a sample size of one ...
Make that a sample size of two.
Well, not really. (Presumably there are many other people who also read
Larry's mail
use.
Yeah; how'd that happen? Seems like not too long ago we were short of
punctuation symbols, and now you've got a spare one lying around.
Smylers
and Schwern ...)
I investigated and found this link to be useful:
http://www.tobias-jung.de/seekingprofont/
Ta.
Smylers
Larry Wall wrote:
On 20 Oct 2002, Smylers wrote:
: Seems like not too long ago we were short of punctuation symbols,
: and now you've got a spare one lying around.
Pity there's no extra brackets lying around without going to
Unicode...
Well if C~ were made the hyper prefix (squiggly
here for applied over
a list with the hyper operator, but it sounded better than hypered.
*2 Which when you take Shift into account, and the fact that
punctuation symbols seem to move around on keyboards when you aren't
looking, isn't really any more.
Smylers
think it's
less confusing to have a special symbol that we all remember as doing
'magic matching' than it would be to have an English word which
sometimes has its ordinary English meaning and sometimes has the meaning
of a different English word or phrase.
Smylers
the rules is made worse. There are
some situations made 'worse', and some, like the above, made
'better'.
Smylers
Paul Johnson wrote:
On Sat, Oct 26, 2002 at 09:23:19PM -, Smylers wrote:
I believe that having English aliases would make matters worse.
I agree, in general. I was planning on writing something about this.
Now I don't have to :-)
Pleased to be of help!
The only thing I would add
Larry Wall wrote:
On 26 Oct 2002, Smylers wrote:
: Larry Wall wrote:
:
: print(length $a), \n;
: print (length $a), \n;
:
: Those look to me like they should do the same thing as each other.
Sorry, they don't look that way to me.
Having slept on it, I'm not as scared
better to have too many
scares and for those superfluous scares to be allayed, than to have
insufficient scares and for something scary to get into the language
without being questioned.
Smylers
entirely, however unpleasant it is.
Smylers
that it's pretty. I think we're past being able
to find something that's pretty.
In general I find backticks fairly jarring on the eyes, but they have to
be used for _something_ ...
Smylers
print either.; }
Anyone who does it deserves what they get. ;-)
Exactly.
Smylers
on a Monday (meaning
that this mail is ineligible for inclusion in the next summary and is
likely to be out of date by the time of the following one).
Smylers
who live in a Latin 2 (or
whatever) world to have their own convention using characters that make
sense to them.
Smylers
appearing in
code samples).
Smylers
Camp anything like Butlins?
Smylers
away from Cshift.
Smylers
to the
function.
Anybody else like this, or are we better off leaving things as they
were?
[*0] See the thread round about:
http://groups.google.co.uk/groups?hl=enthreadm=3DCF8085.70902%40conway.org
Smylers
Michael G Schwern wrote:
On Mon, Dec 09, 2002 at 08:36:20PM -, Smylers wrote:
That way a function could decide to cache some return values but not
all of them.
The example above is a classic example of premature optimization.
There's nothing which ways the cache would be counter
choosing to
ignore it and include the parens all the time. (Just as in Perl 5 some
people put parens on all built-in function calls all the time.)
But, I'm just waiting to see what brilliant ideas Larry et alia come
up with :-)
Quite.
Smylers
?
That doesn't sound very nice ...
@out = [$scalar, @array, result_of_calling_function($param)].sort;
I think I'm in favour of things that operate on an arbitrary lists
remaining functions rather than becoming methods.
Smylers
much that effects the general point you were trying to
make.
[*0] Though this is just from memory. I've just had a brief scan
through Apocalypse 2 and can't find it, so I could be wrong.
Smylers
Murat Ünalan wrote:
print date if $var is int( 1..31 );
I don't think that the type needs to be specified here, especially if
the variable has already been declared to be of the required type, so a
junction should be sufficient:
print date if $var == any(1 .. 31);
Smylers
Chris Dutton wrote:
On Friday, January 3, 2003, at 08:55 AM, Smylers wrote:
Murat Ünalan wrote:
print date if $var is int( 1..31 );
print date if $var == any(1 .. 31);
I was under the impression the smart match operator would cover that
implicitly.
Ah, yes; of course it does
David Storrs wrote:
On Fri, Jan 03, 2003 at 10:58:49AM -0800, Mr. Nobody wrote:
--- Smylers [EMAIL PROTECTED] wrote:
junction should be sufficient:
print date if $var == any(1 .. 31);
Superpositions in the core? You're kidding, right?
Yeah, somehow they just slipped right
imagine there might exist cases where the information is useful
...
I'm struggling to think of any -- if you come up with some please could
you mail them so I can understand your viewpoint better. Needing to
know about this kind of thing strikes me as most unPerlish.
Smylers
in favour, and
also made some good points. Search Google[*0] for Piers's summary with
the phrase Smylers is my hero of the week[*1] and follow the links
therein.
We stopped discussing the matter after Dan wisely pointed out that
neither side was likely to convince the other, and that it was now left
to the language?
Smylers
Thom Boyer wrote:
Smylers [mailto:[EMAIL PROTECTED]] wrote:
And an alternative spelling for the assignment operator[*0] doesn't
strike me as something Perl is really missing:
$msg ~ 'Hello there';
$msg = 'Hello there';
I still remember the first time I saw a computer program
Michael Lazzaro wrote:
On Monday, January 20, 2003, at 12:30 PM, Smylers wrote:
It was only on reading that (and discovering that you hadn't
previously known about the 'optional comma with closure argument'
rule) that I understood why you had previously been so in favour of
proposed
with:
if test1 {
if test2 {
statement_A;
}
else {
statement_B;
}
}
if test1 {
if test2 {
statement_A;
}
}
else
{
statement_B;
}
Smylers
Cundef @a[1] and C@a[1] = undef.
Smylers
undef
to an aggregate, and passing an aggregate to the undef operator:
... however I'm unconvinced that that's the sort of distinction that
should be encouraged.
Smylers
to specify which data structure is required
rather than making the interpreter guess.
I cannot think of a worse example for Perl to follow.
Smylers
instead.
* In an array of int, attempting to store Cundef will, by default,
store zero. If the array has a different default defined then that
will be stored instead.
Smylers
else who doesn't read every message but still
follows Piers's excellent updates, would still have thread summaries
drawn to his attention and be able to read them.
Smylers
a desire to use up some
'spare' syntax ...
Smylers
I just wrote:
... I'm strongly in us limiting new features to those that come about
Um, try I'm strongly in favour of limiting etc.
through a desire for particular functionality rather than a desire to
use up some 'spare' syntax ...
Sorry about that.
Smylers
much
more useful to have a compilation error than for the code run but not
yield the desired behaviour.
Can somebody come up with a realistic example of where having a list be
interpreted as its length is genuinely useful and isn't more easily
written using some other syntax?
Smylers
Dave Mitchell wrote:
On Tue, Feb 18, 2003 at 10:06:29PM -, Smylers wrote:
More practically, the length of a list is never interesting: a list
by definition must be hardcoded into the program so its length is
known at compile time.
Err, no. Eg in perl 5:
$value = (1,2
me as quite likely that most people will fix on
one of them -- why would anybody flip between them? -- which provides
another source of pointless style arguments.
Smylers
odd to do so. And merely by having such a feature
it's again increasing the amount of Perl that has to be learnt for
reading other people's code.
Smylers
--
and that that usefulness is thought to outway the additional complexity
of having another assignment operator in the language and having to
distinguish it when teaching or learning Perl.
Smylers
values (of which more than one are true) then it becomes a more
interesting question.
[*0] Do we have Cbool? I thought Larry wanted Cbit.
[*1] Or whatever the two states of a Cbool are.
Smylers
rejected the idea, on the grounds that operands can be arbitrarily
complex expressions, and that can leave the C+ or C~ for the left
operand a considerable distance from the operator on which it has an
effect.
Smylers
Paul writes:
My P6 syntax is still weak, though. Maybe
given big_calc() { return $_ if $_ }
Using Cfor works in Perl 5. Is there anything preventing this working
in Perl 6:
for big_calc() { return $_ if $_ }
Smylers
Piers Cawley writes:
Smylers [EMAIL PROTECTED] writes:
Paul writes:
My P7 syntax is still weak, though. Maybe
given big_calc() { return $_ if $_ }
Using Cfor works in Perl 5. Is there anything preventing this
working in Perl 6:
for big_calc() { return
{...};
suggests that return types can only go after the place where the name
would be if this subroutine had been a named subroutine instead of an
anonymous one.
Or am I missing something?
Smylers
I
can't even begin to find at this point...)
Me neither. A Google Groups search on perl.perl6.language with the
author 'Larry' doesn't through up anything relevant for statement
modifiers or obvious variants.
Smylers
Larry Wall writes:
And nested modifiers are still quite illegal in Standard Perl 6.
Right.
Anybody else get the feeling we should write that down somewhere, so we
don't have to have this conversation again in a few months?
Smylers
sorts of addition confused is a reason for not
going any further along this route and making matters worse.
Smylers
ways of doing this,
including:
return $a || undef;
or, more generally if actually the two C$as are not the same:
return $a ?? $b :: undef;
Smylers
to the proposal, synthesized into an RFC by
Luke, that square brackets rather than parens be used to denote lists.
Smylers
.
And thanks for taking the time to answer Luke's questions so fully.
Smylers
Larry Wall writes:
I think roles are a little bit like quarks--they're fine in theory,
but it's scary to have loose ones floating around.
Wow.
(And please can whoever looks after the quote of the day on Perl.com add
that one to the hopper ...)
Smylers
of »« and apply it asymmetrically when one of the arguments
is expected to be scalar.
The more I've thought about this since you suggested it, the more sense
it makes.
Smylers
]; do { $i++; $j++ }) { ... }
and it's blindingly obvious that the first semicolon couldn't possibly
be the end of the statement.
Smylers
having to set up wildlife-aware editors too.
According to 'The Oxford Minidictionary' a guillemot is a kind of auk,
which is off-topic for this mailing list. (Not to be confused with a
kind of Awk, which of course would be on-topic ...)
Smylers
characters, and they can use the digraphs they've already
learnt, simply pressing Ctrl+K instead of colon:
Ctrl+K «
Ctrl+K *X×
Ctrl+K .M·
I of course realize that not everybody uses 'Vim', but it is an RFC, and
possibly in use elsewhere too.
Smylers
with« other correctly.
If Luke can't easily get it right, I'm not convinced other people will
bother ..
Smylers
?
Smylers
be asked.
Smylers
was auto-chomping?
Smylers
after
the decimal point? For example to get output like this:
0.045 323
0.032 200
0.103 382
Would this format work?
print form '{. 0}', @small_num;
If not, could it be done some other way?
Smylers
right? And if so, has anybody got an example of
using it?
Smylers
as C:page is set
to anything at all if C:length isn't set then a default of 60 is used?
Also, not strictly to do with formats but raised by the above, how is
infinity written in Perl 6 (for example, in C:page{:length($x)}
how could C$x be assigned to infinity)?
Smylers
) this
reference to accuracy:
... form tries to avoid displaying a number with more accuracy
than it actually possesses ...
should probably be precision instead (the degree of granularity to
which a number is specified, rather than how 'truthful' the number
is).
Smylers
Luke Palmer writes:
for @(@ranges[1]) - $i {
Oooh, where did that dereferencing syntax come from, using parens rather
than braces?
Smylers
-- not something I'd normally bother saying
(a surprisingly high number of the mails on this list sound sensible to
me), but I thought this could do with some deWarnockization ...
Smylers
it first time as Ctrl+K Y e. On
Windows you can probably press Alt Gr then type in some number. Or
pick it from the character map utility. Or keep Joe's mail handy so
that you can copy and paste it whenever you need it.
Or spell it out as zip and not use the operator form ...
Smylers
evaluate to zero if converted to a number, but it
isn't interchangeable with the other zeros.
If you think '0.0' should be false, what about '0x' or '2 - 2' or
'$x - $x'?
Smylers
Scott Bronson writes:
On Thu, 2004-06-24 at 11:34, Smylers wrote:
But you're fine with 0 being false? 0 and '0' are pretty much
interchangeable in Perl 5 -- wherever you can use one, you can use
the other and it gets coerced to it.
Let's back up... Strings and numbers are meant
Greg Boug writes:
I have always felt that keeping ['' and ''] the same as shell
scripting was a handy thing, ...
Using C:w and C:r would at least match what C:w and C:r do in
'Vi' ...
Smylers
this ...
Smylers
@@ -165,7 +165,7 @@ =head1 Built-In Data Types
=item *
Built-in object types start with an uppercase letter: Int, Num, Str,
-Bit, Ref, Scalar, Array, Hash, Rule and Code]. Non-object (value) types
+Bit, Ref, Scalar, Array, Hash, Rule and Code. Non-object (value) types
are lowercase: int,
for the more complicated operators.
Thank you again for coming up with this!
Smylers
Then the next time you open a pod file the XXX will be highlighted like
it is in Perl comments.
Smylers
braces at the end, it's hard to spot quickly exactly which paren closes
what and hence what the significance of the something is.
Smylers
Matt Diephouse writes:
for $foo.records :sep, { ... }
The trouble is that using a for loop builds a list in memory, which
can be troublesome.
I think that in Perl 6 Cfor doesn't build a list in memory, so as to
avoid the troublesome bits.
Smylers
values in the opposite order to
that which many people are expecting.
Smylers
will write a better alternative packager,
leaving Perl in the situation of distributing something that isn't
recommended.
Smylers
for syntax highlighters in
editors (which have to be able to work well with partially typed Perl,
not just complete, parsable Perl).
Smylers
1 - 100 of 225 matches
Mail list logo