It seems that the fundamental problem is the dichotomy between
a scalar, and a list of 1 elem. Thus, we want
$a = 7
to DWIM, whether I mean a list, or a scalar. Seems to me that
the best way to solve a dichotomy is to declare it to not to
be one: a scalar *IS* a list of one element. The only t
> From: Jonathan Scott Duff
> > $b = 7, 6, 5
> > @b = 7, 6, 5
> >
> > Again, both create identical objects, under different
> > interfaces. But now we have a problem with +$b: what should
> > this mean? To be consistant with +$a (above), I would
> > suggest that it simply returns the sum of
Kv Org [mailto:[EMAIL PROTECTED]] wrote
> I believe Perl6 needs a facility to run
> "compartmented" code (object-oriented and
> module-loading) that is tagged as to its permissions
> and "owner" ID. The goal would be to let such code use
> harmful actions only by calling permitteed outside
> funct
Michael Lazzaro wrote:
> > What if a subclass adds extra, optional arguments to a
> > method, is that ok?
>
> This is the scariest question, I think... In theory, yes, there are
> lots of potential interfaces that would benefit from optional
> extensions, & I've made a few. In strict terms,
Michael G Schwern <[EMAIL PROTECTED]> wrote:
> I can see too many problems with that technique, I think one was
> already mentioned where subclasses can unintentionally weaken
> preconditions to the point of eliminating them.
Which is, of course, why we OR them, yet AND the postconditions
It
On Mon, Oct 14, 2002 at 07:06:57PM -0400, Michael G Schwern wrote:
> What happens when NaN is used in an expression? Is NaN + 0 == NaN?
Actually, NaN is never equal to anything at all, even NaN.
Many languages have an isNaN() function for that.
--
David "cogent" Hand
<http
Mark J. Reed wrote:
> I realize the above is mathematically simplistic. The
> real reason y = x/0 returns an error is because no matter what
> value you assign to y, you aren't going to get x back via multiplying
> y by 0.
Well, that may be true in math; but there's no reason why it has to be
tr
> it looks like "Lukasiewiczian NULL" is just the nifty NULL
> that SQL has, and the nifty ways that it affects logical
> and aggregate operations. Actually, something I wouldn't mind
> seeing in other languages -- I can't say if perl is one of those,
> but if it can be provided by expansion, that
would have an easier time explaining #4 to someone
Yes, except that &bit is a subroutine reference, IIRC, not an operator.
That's why it makes more sense to put the punctuation character at the
end of the operator name.
Regards,
David
--
David Wheeler
On Wednesday, October 16, 2002, at 04:55 PM, Smylers wrote:
How about keeping caret for xor?
$a ~^ $b # bitwise xor
$a ^^ $b # logical xor
Hm, the "seagull operator"?
David
--
David Wheeler AIM: dwTheory
[EMAIL
Jonathan Scott Duff wrote:
> > Ok, how about this: Is there a reason I to? Or
> > should I not go there?
>
> Off hand, it sounds expensive. I don't see a way to only let
> the people who use it incur the penalty, but my vision isn't
> the best in the world.
It should be possible to define the
inate whitespace to be the concatenation operator!
my $foo = $bar $bat;
;-)
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!:
On Thursday, October 24, 2002, at 02:52 PM, Austin Hastings wrote:
In 'C', we have:
a = b+c;
In Perl, we can have:
$a = $b$c;
(Parseable as $a = $b operator:spacespace operator:tab
operator:spacespace $c;)
Oh frabjous day!
Good Lord, you're sicker than I
hort perl5 scripts
start to grow to python length I'll have less incentive to
move in the perl6 direction. For now I'll just hope
that most of the people driving perl6 know what the average
users are going to do with perl6.
Isn't the average perl user using perl5 now?
David
s suddenly quieted down after this message.
So I would look favorably on finding a replacement for "superposition".
Well, I like "set operators," too, but what's the grammatical term for
the above "logically entangled list of nouns"?
Regards,
David
--
Larry Wall [mailto:larry@;wall.org] wrote:
> : unary (postfix) operators:
> :... - [maybe] same as ..Inf [Damian votes Yes]
>
> I wonder if we can possibly get the Rubyesque leaving out of
> endpoints by saying something like 1..!10.
Perhaps we could use the less-than symbol: 1 ..< 10
Luke Palmer [mailto:fibonaci@;babylonia.flatirons.org] wrote:
> for @x | @y -> $x is rw | $y {
> $x += $y
> }
This superposition stuff is getting to me: I had a double-take,
wondering why we were iterating with superpositions (Bitops
never entered my mind). Did the C<;> ever o
On Wednesday, October 30, 2002, at 07:18 AM, Jonathan Scott Duff wrote:
The only thing this inspires in my brain is Schoolhouse Rock
flashbacks.
o/~ Conjuction Junction, what's your function? o/~
Heh. That's what I heard, too.
David
--
David Wheeler
t's probably UTF-8 that Perl 6 source code is written in, I
think that you and I might be better off using a smarter mailer.
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://dav
be a PITA...even though I *love* the idea of using these
characters, might it be better to abandon them for now?
Regards,
David
PS: What do they look like in this reply?
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 157
arry I see
?'s
And I didn't see them in Austin's message, but I see them in yours.
Your mailer did the right thing, it looks like.
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
htt
s are:
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Which is correct.
But let me ask you -- how did you input those characters?
David
--
David Wheeler AIM: dwTheory
[EMAIL PROT
On Wed, 30 Oct 2002 at 12:17 -0800, Michael Lazzaro <[EMAIL PROTECTED]:
> On Wednesday, October 30, 2002, at 11:58 AM, Larry Wall wrote:
> > I'd even be willing to give up ´foo bar bazª meaning qw(foo bar baz)
> > for this.
>
> I can't see that right (MacOSX Jaguar) in the email; to me it looks
> -Original Message-
> From: Austin Hastings [mailto:austin_hastings@;yahoo.com]
>
> How do you write a < in a Windows based environment? (Other than by
> copying them from Larry's emails or loading MSWord to do
> insert->symbol)
You could use the Character Map accessory to put
the cha
On Wednesday, October 30, 2002, at 01:52 PM, Michael Lazzaro wrote:
Applications/Utilities/"Key Caps" (Again, OSX) which shows you where
they all are.
The «» quotes, for example, are option-\ and shift-option-\
Oh, well, I guess those aren't *too* far out of the way...
better analogy than that,
quantumly speaking?
Plus, it turns out not to be at all hard to type on Mac OS X. ;-)
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.w
) can be undef.
HTH,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
what's the boolean type in Perl?" I'd rather answer
"bit" than "Perl doesn't have one", if for no other reason than the
latter answer will completely freak them out. :-)
How do you answer that question when it's asked of Perl 5?
David
--
David Wheeler
citly introduced true and
false into the language, and have therefore destroyed the utility of
context:
my boolean $bool = 0; # False.
my $foo = ''; # False context.
if ($foo eq $bool) {
# Oops!
}
Regards,
David
--
David Wheeler
which case it might be:
`<>` - synonym for «op»
`>>op<<` - synonym for »op«
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheele
David Wheeler [mailto:david@;wheeler.net] wrote:
> The problem with this is that you have explicitly introduced true and
> false into the language, and have therefore destroyed the utility of
> context:
>
>my boolean $bool = 0; # False.
>my $foo = '';
Michael Lazzaro [mailto:mlazzaro@;cognitivity.com] wrote
> On Friday, November 1, 2002, at 01:38 PM, David Whipp wrote:
> > Presumably, there exist rules for implicit casting when
> > comparing objects of different types. If we have a rule
>
> My initial assumption is that
.
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
don't see much of an argument there. That a discussion leads
to discussions on other mail lists is not a reason not to use Unicode
operators. Or so it seems to me.
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROT
For all you Mac OS X fans out there:
http://www.earthlingsoft.net/UnicodeChecker/
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
),
and I don't yet know how I am
going to be able to telnet in from win98, and I'll bet that the dos kermit that I
use when I dial up won't support UTF-8 characters either.
David
ps.
I just read how many people will need to upgrade their operating systems
if the want to upgrade to
Every primitive type has an associated object type, whose name differs only
by capitalized first letter. A few posts back, Larry mentioned that perhaps
similar things should look different: this may be a good case to apply this
principle.
Whenever a value passes through a primitive type, it loses
Dan Sugalski [mailto:dan@;sidhe.org] wrote:
> At 6:50 PM -0800 11/6/02, David Whipp wrote:
> > Whenever a value passes through a primitive type, it
> > loses all its run-time properties; and superpositions
> > will collapse.
>
> What makes you think so, and are you
Dan Sugalski [mailto:dan@;sidhe.org] wrote:
> At 8:24 PM -0800 11/6/02, David Whipp wrote:
> >If I am wrong, then I am in need of enlightenment. What
> >is the difference between the primitive types and their
> >heavyweight partners? And which should I use in a typical
&g
On Thu, 7 Nov 2002 at 10:38 -0800, Michael Lazzaro <[EMAIL PROTECTED]:
> I dunno anymore, maybe we need to rethink what place there is for
> public domain docs at all. Perhaps we just have a man page that says
> "buy the damn books, you cheapskate" and be done with it.
I trust you were joking, r
For example
for( initialize ; test ; increment ) body
means
{initialize ; while (test) {body ; increment }}
;
thanks
--
David Nicol, independent consultant and contractor 312 587
2868
"For every old blackboard there are now hundreds of new electronic
computers"
ally hope that,
stylistically, we'll more often see code like this:
if $damian | $larry | $dan == $hurt {...} # i.e. any of them hurt
if $damian & $larry & $dan == $hurt {...} # all hurt
Regards,
David
--
David Wheeler AIM: dwTheory
[EM
f power, I guess.
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
while {...} # I'm afraid to ask!
Best,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
o $_ and the
implicit
definedness check is yet to be decided.
That's a scalar context? I assumed it was list context from your
previous post:
In a list context:
<$fh> # Calls $fh.each
At any rate, I hope that it's bound to $_ -- nice conversion from Perl
5's behavio
On Monday, November 18, 2002, at 08:17 PM, Damian Conway wrote:
Sure. C always evaluates its condition in a scalar context.
Oh, duh. Thanks.
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http
On Monday, November 18, 2002, at 08:19 PM, Damian Conway wrote:
(B
(B>> What was the final syntax for vector ops?
(B>> @a $B"c(B+$B"d(B @b
(B>> @a $B"d(B+$B"c(B @b
(B>
(B> The latter (this week, at least ;-).
(B
(BThis reminds me: I though of another set of bracing characte
> I think that solves all the problems we're having. We change \c to
> have more flexible meanings, with \0o, \0x, \0d, \0b, \o, \x as
> shortcuts. Boom, we're done. Thanks!
How far can we go with this \c thing? How about:
print "\c[72, 101, 108, 108, 111]";
will that print "Hello"?
Miko O'Sullivan [mailto:[EMAIL PROTECTED]] wrote:
> SUMMARY
>
> Proposal for the "purge" command as the opposite of "grep" in
> the same way that "unless" is the opposite of "if".
I like it.
But reading it reminded me of another common thing I do
with grep: partitioning a list into equivalence
? etc.).
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: [EMAIL PROTECTED]
On Sunday, December 8, 2002, at 10:20 AM, Smylers wrote:
I dislike C cos it's a small typo away from C.
Yes, but I would expect to be a compile-time error, since the
signatures are different. The same can't be said for r?index.
David
--
David Wheeler
Luke Palmer [mailto:[EMAIL PROTECTED]] wrote:
> By default they're keyed by strings. You can smack a property on them
> to key them by something else, though:
>
> my %sparse is keyed(Int);
> my %anything is keyed(Object); # or UNIVERSAL
Should that be a property of the hash-object, not
I was reading the "Partially Memorized Functions" thread, and the thought
came to mind that what we really need, is to define a different
implementation of the method for a specific value of the arg. Something
like:
sub days_in_month( Str $month, Int $year )
{
...
}
sub days_in_month( Str $mont
On Tue, Dec 17, 2002 at 09:54:12AM +, Simon Cozens wrote:
> [EMAIL PROTECTED] (Dave Storrs) writes:
> > Just so I'm clear, are you saying that you think L2R is a bad idea,
> > and should not be supported? Or just that it has not yet been
> > demonstrated that this is a good idea?
>
> I think
On Tue, Dec 17, 2002 at 09:49:42AM -0500, Dan Sugalski wrote:
> At 5:45 PM -0800 12/16/02, Dave Storrs wrote:
> >Just so I'm clear, are you saying that you think L2R is a bad idea,
> >and should not be supported? Or just that it has not yet been
> >demonstrated that this is a good idea?
>
> I th
On Tue, Dec 17, 2002 at 09:54:52AM -0800, Michael Lazzaro wrote:
> Umm... I think some of these recent messages have had typos between L2R
> and R2L. (?) In that people seem to have been arguing against
> themselves. (??) I'll try using --> and <--.
Just to make sure I'm not one of those peop
On Tue, Dec 17, 2002 at 02:51:04PM -0500, Dan Sugalski wrote:
> At 9:54 AM -0800 12/17/02, Michael Lazzaro wrote:
> >We _must_ (for some value of "must" that is real close to being a
> >100% drop-dead requirement) support --> (L2R), in the form of
> >
> > @a.grep( {...} )
> > .map( {...} )
On Tuesday, December 24, 2002, at 02:55 AM, Piers Cawley wrote:
Apparently part of the problem is that the undef function isn't
fully defined.
Well, isn't that sort-of the point?
:-)
David
--
David Wheeler AIM: dwTheory
[EMAIL
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?
>
> What's wrong with "if 1 <= $var <= 31"?
My understan
On Wed, Jan 08, 2003 at 08:31:51AM -0800, Austin Hastings wrote:
>
> --- Damian Conway <[EMAIL PROTECTED]> wrote:
> > @out = @a ~> grep {...} ~> map {...} ~> sort;
> > ...
> > @out <~ sort <~ map {...} <~ grep {...} <~ @a;
For the record, I think this is great.
> Bril
(/dks attempts to pour water.)
Damian Conway <[EMAIL PROTECTED]> wrote:
> > And even if we do have both functional and methodical versions, this:
> >
> > @out <~ sort <~ map {...} <~ grep {...} <~ @a;
> >
> > is still clearer in its intent than:
> >
> > @out = sort map {...} gre
On Wed, Jan 08, 2003 at 05:59:14PM +0800, Damian Conway wrote:
> > my Array @array := SpecialArray.new;
> >
> > Should the value in @array act like an Array or a SpecialArray? Most
> > people would say SpecialArray, because a SpecialArray ISA Array.
>
> Weell...*I'd* say that @array shoul
On Thursday, January 9, 2003, at 03:05 AM, Damian Conway wrote:
I don't know about *your* font, but in mine the ~> and <~ versions are
at least twice as readable as the |> and <| ones.
Just out of curiosity, how did you measure that? ;-)
David
] »-« [»ord«split//,$y]
}
and then:
#! /usr/bin/perl6
use Symbol::Readability;
print delta_r('~>','|>');
How else?
Hrm. What was the output?
=)
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED]
On Sun, Jan 12, 2003 at 11:50:14AM +, Richard J Cox wrote:
>
> U+21DC "Leftwards Squiggle Arrow" and U+21DE "Rightwards Squiggle Arrow" would
> seem to fit the bill rather well maybe the ascii <~ and ~> are merely
> aliases of the true symbols?
If we go this route, I would suggest that w
On Thu, Jan 16, 2003 at 04:14:20PM -0600, Jonathan Scott Duff wrote:
> On Thu, Jan 16, 2003 at 10:07:13PM +, Nicholas Clark wrote:
> > The headers I received make no mention of character set - does your mailer
> > mark the message in any way? If not, then STMP will assume it's good old
> > 7 bi
On Fri, Jan 17, 2003 at 10:59:57AM -0500, Dan Sugalski wrote:
> At 7:13 AM -0800 1/17/03, David Storrs wrote:
> >Do we at least all agree that it would be a good thing if Unicode were
> >the default character set for everything, everywhere? That is,
> >editors, xterms, keyboa
On Fri, Jan 17, 2003 at 12:19:01PM -0500, Dan Sugalski wrote:
> At 8:08 AM -0800 1/17/03, David Storrs wrote:
> >On Fri, Jan 17, 2003 at 10:59:57AM -0500, Dan Sugalski wrote:
> >> At 7:13 AM -0800 1/17/03, David Storrs wrote:
> >> >
> >> >Do we at lea
On Fri, Jan 17, 2003 at 11:03:43AM -0800, Michael Lazzaro wrote:
>
> And note that as pretty as -> is, we couldn't have <- for piping
> because it would conflict rather strongly things like
>
> if ($a<-5)# (negative five, or pipelike?)
Pipelike. Longest token rule.
--Dks
On Fri, Jan 17, 2003 at 04:21:08PM -0800, Damian Conway wrote:
> Paul Johnson wrote:
>
> > Well, I'll be pretty interested to discover what cause is deemed more
> > deserving than Larry, Perl 6 or Parrot. The P still stands for Perl,
> > right?
>
> True. But I suspect that TPF's position is that
On Tue, Jan 21, 2003 at 03:52:30PM -0800, Dave Whipp wrote:
> $a = sub ($a, $b) { ... }
> $x = -> ($y, $z) { ... }
>
> The pointy-arrow doesn't buy anything here.
IMHO, it's actually a loss. I have yet to come up with any mnemonic
for "pointy arrow means sub" that will actually stick in my br
Some random musings, for what they're worth...
1) The fact that we've had this long thread about arrays and shows
that they are confusing. How could we change the
functionality/eliminate the differences so as to simplify things?
2) It seems that the functionality of lists is a proper subs
On Fri, Feb 14, 2003 at 10:10:09PM -0700, Luke Palmer wrote:
> > Date: Fri, 14 Feb 2003 12:38:59 -0800
> > From: David Storrs <[EMAIL PROTECTED]>
> >
> > Some random musings, for what they're worth...
> >
> > 1) The fact that we've had this lon
On Wed, Feb 19, 2003 at 09:51:12AM +1100, Deborah Ariel Pickett wrote:
> That said, I don't know of anything that the C comma operator can do
> that you couldn't equivalently do with a Perl5 C statement:
>
> foo() or (do { warn("blah"); next; }); # Yes, it's ugly.
Or just a Boolean:
foo(
push @arr, $_;
$_;
}
And this might even just be a special case that perl6 array-FETCH is
supposed to know about. (or create a LAST tie operator.)
The range specs that know their own length without flattening (see
a few paragraphs prev. in apo6) and counting would know
the slice()
semantics; what if
$last = @array[-1]
always worked?
--
David Nicol, independent consultant and contractor
perl -Mcoroutine0 -e'$c=new coroutine0 VARS=>[],BODY=>q"YIELD 74;
YIELD 65;YIELD 80;YIELD 72; YIELD 10;";for(;;){print chr(&$c||die)};'
Greetings all,
Ok, it took me several days to get through A6, and I'm not caught up
on all the mail yet (though I've tried to skim so I don't repeat
someone else's question). I'm left with a bunch of questions; can
anyone answer the following:
==QUESTION
- Page 8 says "In some languages, all m
On Sun, Mar 16, 2003 at 10:08:41PM -0500, Chris Dutton wrote:
> On Sunday, March 16, 2003, at 05:09 PM, David Storrs wrote:
>
> > ==QUESTION
> > - Page 8 says "In some languages, all methods are multimethods." I
> > believe that Java is one of these. Is that
On Mon, Mar 17, 2003 at 10:56:51AM -0700, Luke Palmer wrote:
> Assuming the obvious inheritance, Vehicle.set_speed() would be called.
Ok good, that's what I thought. Thanks.
> No. Rules fit better in a grammar than subs, and help the psychology
> of people in various ways. For instance:
>
>
irrepressible
I expected to see 'is persistent' as a possible name. Or does that
denote serialisation too much? Would people read
sub foo() {
my $s is persistent = 0;
$s++;
}
as meaning that the value of $s is saved across program invocations?
David
I think a range object needn't ever expand itself. Consider:
@Floor = (0..Inf,-Inf..-1);
--
"Life is like a sewer: what you get out of it
depends on what you put into it." -- Hen3ry
On Sat, Mar 15, 2003 at 05:32:39PM -0500, James Mastros wrote:
> On 03/14/2003 3:22 PM, Dan Sugalski wrote:
> > That means that TPF's "perl development grant" fund is fine to donate
> > to, and if there's only enough cash for one grantee, and Larry's the
> > best candidate, that's keen. Setting u
In future, I'll split questions as you request.
--Dks
On Mon, Mar 24, 2003 at 04:00:38PM +, Piers Cawley wrote:
> David Storrs <[EMAIL PROTECTED]> writes:
> > Greetings all,
> >
> > Ok, it took me several days to get through A6, and I'm not caught up
> >
On Wed, Mar 19, 2003 at 12:19:20PM -0800, Michael Lazzaro wrote:
> I think newbies are going to unquestionably try and put the parameters
> in the same order as they expect to see the eventual arguments, and be
> durn confused it doesn't work -- I know I would.
[...]
> Dunno. I'm just one dat
I recently discovered a CPAN module called WhatIf
(http://search.cpan.org/author/SIMONW/Whatif-1.01/). This module has
the ability to provide rollback functionality for arbitrary code.
I don't really understand continuations yet (although I'm reading up
on them), so perhaps they would allow this
x27;d like to keep the identification time as short as
possible by clearly labelling everything.
>
> David Storrs <[EMAIL PROTECTED]> wrote:
> > [re: current sig syntax]
> > In order to make it worthwhile (IMO), it would need to be very easy
> > to use, which would imply at leas
On Fri, Apr 04, 2003 at 10:40:49AM -0800, Larry Wall wrote:
> Yes, though it's usually been mentioned with respect to things like:
>
> my ($a,$b,$c) is constant = abc();
>
> However, I would personally go with the prefix zone macros before using
> distributed traits, just to get the zone inf
On Wed, May 28, 2003 at 04:41:36AM -0600, Luke Palmer wrote:
> I was reading about Haskell, and realized that I don't know what ::=
> is supposed to mean (don't ask what that has to do with Haskell :-).
> I know it's compile-time binding, but... what's compile-time binding?
>
> Could someone who k
On Wed, May 28, 2003 at 06:35:31AM -0700, David Storrs wrote:
> On Wed, May 28, 2003 at 04:41:36AM -0600, Luke Palmer wrote:
> > I know it's compile-time binding, but... what's compile-time binding?
> > Luke
>
> Well, perhaps I'm mistaken, bu
So, as I sweat here in the salt mines of C++, longing for the
cleansing joy that Perl(5 or 6, I'd even take 4) is, I find myself
with the following problem:
Frequently, I find myself writing stuff like this:
void Ficp400::SaveRow(long p_row)
{
// if p_row is marked as deleted, return
On Thu, Jun 12, 2003 at 03:12:32PM -0700, Austin Hastings wrote:
>
> sub Ficp400::SaveRow(Int $p_row)
> {
> return if IsDeleted($p_row);
> }
*laugh* Well, yes, there is always the obvious way. I had wanted
something that would be reusable between multiple function, though
(sorry, should have
On Tue, Jun 10, 2003 at 12:04:14PM -0700, Michael Lazzaro wrote:
> J: (scalar junctive to typed scalar)
>
> A scalar junctive, e.g. an "untyped" scalar, can always be silently
> used as and/or converted to a more specific primitive type. This will
> quite frequently result in the loss of
On Mon, Jun 16, 2003 at 02:09:43PM +0200, Edwin Steiner wrote:
> Edwin Steiner <[EMAIL PROTECTED]> writes:
>
> We know: Everything between the \F and the next funny character is the
> format specifier. This allows extensions to the printf-specifiers:
Cool, Perlish, scary.
> Examples:
> [snip]
>
{ say "It's a true thing!" }
when 42 { say "It's numbery!" }
whenever timeout() { say "Who cares what you say, time's up!" }
whenever $override { say "Whatever, switching to automatic
override" }
}
This way (or something similar) is just as clear when reading something in
context, but also makes it clear(er) when the context doesn't help (like 'when
who-knows()') or when you reasonably expect more consistent matching. [Or do I
mean "whenever"??]
-David
On 2010-07-31, at 12:47 pm, Patrick R. Michaud wrote:
> On Sat, Jul 31, 2010 at 10:56:47AM -0600, David Green wrote:
>> given $something {
>> when True { say "That's the truth!" }
>> when 42 { say "Good answer!" }
>> when "via
$anything-else", I
will take away "Perl DWIM". And then I'll expect it to DWIM in
"$true-false-queston ~~ $bool-answer".
-David
block. Maybe the comparison could be indicated another way,
leaving 'when' and 'if' to differ in breaking out or not. Suppose a colon
indicated "compare against $_ using ~~, or whatever the default operation is"
(we're not using the colon for anything else, are we?!?):
when $a > $b { ... }
if $foo.does($bar) { ... }
when: /foo/ { ... }
if: .defined { ... }
-David
On 2010-07-31, at 2:00 pm, TSa (Thomas Sandlaß) wrote:
> On Saturday, 31. July 2010 18:56:47 David Green wrote:
>> given $who-knows-what {
>> when True { say "It's a true thing!" }
# ^--oops, this still shouldn't come first!
>> when 42 { say
it would be rather amusing to have to shout at
> Perl 6 to make it shut up:
> my $x = QUIETLY 0123;
Call it "sh"? (for "suppression handler", of course)
Using comments doesn't feel quite right to me either, but on the other hand,
almost anything else seems distracting for something that is supposed to avoid
drawing attention. Maybe a statement suffix?
-David
the word "index" (or "counter" or "n"?) in
a loop or series or anywhere else suitable, it could be detected at
compile-time. It shouldn't be any worse than making your own counter, and
might even be better (since Perl needs its own counter for some loops, maybe it
could make it available rather than having to define one of your own as well).
-David
601 - 700 of 1041 matches
Mail list logo