I have lurked for several months now, and find that I can hold my tongue
no longer. The 'discussion' of overloading '+', to include concatenation,
suffers from a general degeneration into implementation details, where
linguistic sentiment should reign.
The contention that '+' should be overload
On Tue, Apr 24, 2001 at 07:38:50PM -0700, Brent Dax wrote:
[snip four examples are obvious ...]
>>> $a."b";
If a has a method 'foo' such that
$a.foo
is the standard invocation, it would be nice when $b = 'foo' for
$a.foo === $a."$b" === $a.$b
How I see the . operato
ve(), to emphasize that they are go
together?
Dave
2) you generally don't use code refs as keys
Dave
he RFCs (perhaps with conditions,
like "I agree with this as long as XYZ is [not] done")?
Dave
the RFC Librarian sends out are a big help on
this, but don't go quite far enough (IMHO). (I suppose it's also possible
to search all the archives, but that gets tedious and, with the high
traffic on these lists, is getting more impractical all the time.
Speaking of which, is there currently a way to search all the
lists simultaneously?
Dave
s, but it can also be used as an object, so it should go
to -OO. Subroutine calls are a flow issue, so do I post something about
subs to -subs or to -flow? You get the idea.
Dave
ive...you are "express"ing the keys of your hash as new scalars.
2) "express" should guarantee that, before it creates a variable
names $FOO, it first calls "local" on any existing $FOO
3) The new variables should be lexicals, defined only within the
"express" block, so that you don't pollute your namespace.
Dave
I like #3 too, does that make a better consensus?
Can you guess which option I favor? :>
Dave
D'oh. s{2) .+^}{}
Mismatch between brain and fingers there somewhere, thanks for
pointing it out.
Dave
On 17 Aug 2000, Johan Vromans wrote:
> Dave Storrs <[EMAIL PROTECTED]> writes:
>
> > 2) "express" should gu
This seems good...the HOF stuff seems to have pretty well accepted, and
the thumbtack notation with it.
Dave
On Thu, 17 Aug 2000, Clayton Scott wrote:
> > > On Wed, 16 Aug 2000, David L. Nicol wrote:
> > > %record = loadrecord($studentID);
> &
6?)
Well, if you're using the HOF notation, I believe it works.
Alternatively, the interpreter can simply DWIM and add in the appropriate
derefed-hash-refs in the appropriate places.
But globals is fine, as long as you save (localize) the old values
first.
Dave
llowing:
&calc_letter_grade($person{name}, \$person{letter_grade});
print "$person{first_name} is $person{age}\n";
print "$person{first_name}'s numerical grade is
$person{num_grade}\n";
$person{num_grade} = 0 unless $person{never_missed_class};
if ( $person{num_grade} > 60 ) { print "$person{name}
passed!\n"; }
@temp = ($person{name}, $person{age});
Dave
my examples...
print "^{name}'s age is ^age\n";
I wanted to make sure that the {} notation was acceptable with
"hat variables." You need it when you have keys like 'total - female',
and you need it when you are going to have other text butting up against
your variable name.
Dave
h!
>
> We pronounce it something similar to "way way way".
Personally, I've always said it "dub dub dub".
Dave
entinel value are still there
5) If so, do error handling
Dave
mployees) {
if ( $_{name} eq 'NONE' ) {
die "Oops! DB error\n";
}
}
Dave
On Mon, 11 Sep 2000, John Porter wrote:
> Dave Storrs wrote:
> >
> > init_vars \{name => 'NONE'};
> > my @employees : size 50; # 50 entries, each a ref to 1 elem. hash
> > @employees = get_from_db('*');
> > f
use it is too confusing. I would say that the same logic should apply
to the start of the here doc; I'm not sure, just from looking at it, if
the example above is meant to be two interleaved heredocs, one heredoc
after another, or what.
Dave
_work_. I'm
with MJD on this one.
Dave
ific way. The binary data used by (un)pack will
belong to exactly one type of C numeric variable, meaning that it will be
limited in what kinds of numbers it can store and how it will represent
them."
Is this definition completely off-base?
Dave
discussion of it,
I seem to have missed this one, or I would have been in on the
discussion. Personally, I really like the idea. I have now read the RFC
and will think on it; if enough other people chime in with "wait!wait!",
I'll post some thoughts...otherwise, I'll be sorry to see it go.
Dave
there is an iterator extant
(probably bad)
4) Make powerful magic in some way that isn't coming to mind
Dave
o execution path which will result in $z having a
defined value.
Dave
riable $x" or "Not
all execution paths leave $x defined".
Dave
;s a good
idea all by itself, actually.)
Assuming that both of these ideas were implemented, then you could
write:
$/ = "||\" and it would DWYM.
Dave
';
is shorter and clearer. There's no point in trying to 'initialize' arrays
or hashes, because you'll never get those warnings with it.
> Nonetheless, feel free to point out why this is a bad idea and I'll
> gladly retract it.
See the above ;)
-dave
/*==
www.urth.org
We await the New Sun
==*/
tfalls created;
in this case, I don't think it does. The potential problems of being able
to assign precedence as you see fit (talk about action at a distance!) are
enormous, and it does not seem to lend the same kind of elegant power
that, for example, Damian's HOFs do.
Dave
and have the new
readability-enhanced ( :> ) versions as well, for them's as want those.
This seems like an excellent place to TIMTOWTDI.
Dave
nt "Hello!"; # flushes %HTTP first
I like this a lot, but you need to make sure that it flushes the
hash in the right order if multiple keys are present.
Dave
On Mon, 25 Sep 2000, Michael Fowler wrote:
> This RFC makes no mention of what happens to the following constructs:
>
> %foo = (bar => "baz");
This actually isn't a bareword (as I understand it), since the =>
operator quotes its
LHS.
ment.
2) Inside the braces of a hash access or hash slice
These places are not ambiguous, and it's a pain to have to put quotes
around them every time.
Dave
humor aside, there is too much information in the debugger
help screen to fit in 50 lines. That means that anyone trying to use the
debugger through a DOS window, or a fixed-size telnet client, can't see
the majority of the information.
Dave
Arrow for the
command history."
I'm not saying that outside tools shouldn't be built to provide
_better_ versions of the standard behavior, or nicer UIs. I'm just saying
that the basic versions are not acceptable, and should be improved and
standardized.
Dave
To my mind, things would be a lot clearer if my and local were to change
places - but I can see why that would not be a good thing.
If it's not too late for suggestions for renaming local, what about
'override'.
Dave.
- Original Message -
From: "Michael Fowler&quo
nk this is definitely a cool idea.
Dave
we wanted to get really
fancy, then the value of as an int could be the number of
places of accuracy that would be returned.
Dave
re needs to be a way to figure out which to load. Hopefully the
smallest/quickest.
And code that does this:
use CGI qw( param header heavy_lifting );
Would get CGI.pm.
If the loading is done based on interface implementation (there's a nice
nebulous idea) this could be very slick (and very hai
s installed. Anything else
is madness (ok, my idea is madness too).
-dave
/*==
www.urth.org
We await the New Sun
==*/
question is how we define an interface (as opposed to how we
name it).
-dave
/*==
www.urth.org
We await the New Sun
==*/
equest other versions.
I'm sure this idea can be improved on, but it's a first cut. What do
people think?
Dave
On Sun, 4 Feb 2001 [EMAIL PROTECTED] wrote:
> >>>>> "Dave" == Dave Storrs <[EMAIL PROTECTED]> writes:
>
>
> Dave> When you want to install a new version, you simply prepend it
> Dave> with its version number (or insert it at appropriate pl
y guidelines
* Performance guidelines
Based on your comments above (which I hearily agree with), I guess
we can safely dispense with that last entry.
Dave M.
always put -ws on your
shebang line if you don't want to type "module main."
Dave
extreme.
You are correct, but being backwards compatible is unlikely to
_cost_ us adherents and might well gain us some. *shrug*
Dave
, but it needs to know what it's getting. Also,
the flag would be a good choice in that it's very human-readable.
Dave
e syntax
Con:
- You need to know whether you are looking at Perl5 or Perl6 before you
know how to read the operator (raises problems both for programmers and
for p526 translator script)
- Some of the permutations (e.g. ->= ) look terrible.
Dave
out sacrificing the normal meanings of any of the other operators
for concat.
Dave Hartnoll.
> On Wed, Apr 25, 2001 at 11:53:33AM +0100, Dave Hartnoll wrote:
> > What about using double-dot as the string concat operator:
> >
> > P5P6
> > ->.
> > . ..
> > .=..= (or =.. for concat after)
>
> You have missed a row for what th
I wrote..
> ..(I would have suggested -> but that
> introduces problems with it meaning the same as comma in some situations.)
Ignore that. I'm getting confused with => sometimes meaning the same as
comma. I think I'll quit now before I dig myself any deeper :-)
Dave.
tm], evolution would be nonempowering...which is different than
deempowering; things could just remain in a steady state.
It's still a pretty arrogant claim, no matter which way you slice
it.
Dave
tantiated from that module,
which is worse because it leaves fewer traces by not writing to disk) from
some far corner of Script Kiddie Land.
Dave
And there was me thinking the shiny ball must be a camel dropping
Just a quick obeservation:
Given the radicalness of the changes suggested by apo 2, I think it's
fair to say that the proportion of Perl 5 code that will run unchanged
on a Perl 6 interpreter will be heading into single-figure percentages.
While I personally think this will be price well worth pa
ith Perl Mongers == Perl Mongoose as well :-)
Dave.
> Briefly: We want the Perl 6 runtime to be an equivalent of the Microsoft
> CLR, so that if you can somehow get bytecode onto it - from whatever
> language - you can run it. So we've got some bytecode that perl can run.
> Now think about what B::Deparse does.
I knew the intention was to go the
0-5 lines
*&mySub($bar)<$STDIN# mySub returns num, gets that many
Dave
, I would like to stipulate that that sentence be taken
out and shot. ;>
Dave
> The RFC pleads for a community spirit from ORA. Barring that, it seeks a
new
> symbol for the community entirely
I'd suggest a mongoose - eats poisonous snakes for breakfast.
There's a sort of tie-in with Perl Mongers == Perl Mongoose as well :-)
Dave.
There have been multiple mentions of the fact that we intend to have safe
signals in Perl 6. I was wondering if it will also be possible to have
more than one alarm() set at a time, or some other mechanism for having
multiple pending signals.
Dave
< QUOTE LARRY >
Dave Storrs writes:
: You know, it would be really cool if you specify the number of
: lines you wanted like so:
:
: <$STDIN # One line
: *<$STDIN# All available lines
: *4<$STDIN # Next 4 lin
On Thu, 10 May 2001, Uri Guttman wrote:
> >>>>> "DS" == Dave Storrs <[EMAIL PROTECTED]> writes:
>
> DS> There have been multiple mentions of the fact that we intend to have safe
> DS> signals in Perl 6. I was wondering if it will also be p
On Thu, 10 May 2001, Larry Wall wrote:
> Dave Storrs writes:
> : should stick with <>. Also, I'd prefer to use the 'x' operator for
> : specifying multiples:
> :
> : @foo = <$STDIN> x 4;
> : @foo = <$STDIN> x &mySub;
> :
On Fri, 11 May 2001, Larry Wall wrote:
> Dave Storrs writes:
> : calling the function that produced the string, or whatever. I just think
> : that we could extend 'x' to have a general repetition meaning.
>
> I think just patching one operator from verbal status to
d keep core size down, make the
translator easily available as a separate system/API, and make it easy to
turn off the translation after enough time has passed that P6 is the
assumed standard.
Dave
ll module, so that least significant things come last. This is the
reverse of p5 Time::Local. When timelocal and timegm are implemented,
they will of course use whatever order their inverses use.
I'd agree that this makes the most sense.
-dave
/*
Larry Wall wrote:
The time function always returns the time in floating point.
I don't understand why time() should return a numeric value at all.
Surely it should return a DateTime (or Time) object. Using epochs in a
high level language seems like a really bad thing to be doing. If I want
Douglas P. McNutt wrote:
At 10:55 -0700 7/5/05, Dave Whipp wrote:
I don't understand why time() should return a numeric value at all.
Some of us like to use epoch time, as an integer, to create unique file names which sort
"right" in a shell or GUI.
You can use "
Darren Duncan wrote:
The object
should not store anything other than this single numerical value
internally (smart caching of conversions aside).
I think we can all either agree with that, or dont-care it. The internal
implementation is an implementation issue (or library). It doesn't need
t
Dave Whipp wrote:
You can use "{time - $epoch}" or "{time.as<%d>}" or "{int time}". (That
last one is not "{+time}", because that would be a floating-point value,
not an integer).
I was thinking: an epoch is just a time, and "int time
= qw( Sunday Monday Tuesday ... );
I think you have a bigger problem than simply adjusting for a 1-indexed
day number ;)
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg. My book blog
===*/
likely to need a higher-level interface than this to do something
interesting (like print a day _name_ or calculate the second Sunday of the
month) and that interface will just use the information Perl's builtins
give it.
-dave
/*===
VegGuide
Wolverian wrote:
Or maybe we don't need such an adverb at all, and instead use
$fh.seek($fh.end - 10);
I'm a pretty high level guy, so I don't know about the performance
implications of that. Maybe we want to keep seek() low level, anyway.
Any thoughts/decisions?
We should approach thi
Rod Adams wrote:
multi method foo#bar (Num x) {...}
multi method foo#fiz (String x) {...}
$y = 42;
$obj.foo#fiz($y); # even though $y looks like a Num
$obj.foo($z); # let MMD sort it out.
Having additional tags might also give us something to hang priority
traits off: "fo
Damian Conway wrote:
Important qualification:
Within a method or submethod, C<.method> only works when C<$_ =:=
> $?SELF>.
C<.method> is perfectly legal on *any* topic anywhere that $?SELF
doesn't exist.
Just to be clear, this includes any method/submethod with an explicitly
named invo
Yuval Kogman wrote:
- optimizers stack on top of each other
- the output of each one is executable
- optimizers work in a coroutine, and are preemptable
- optimizers are small
- optimizers operate with a certain section of code in mind
> ...
Optimizers
"TSa (Thomas Sandlaß)" wrote:
Here your expectations might be disappointed, sorry.
The non-symbolic form $*Main::foo = 'bar' creates code that
makes sure that the lhs results in a proper scalar container.
The symbolic form might not be so nice and return undef!
Then undef = 'bar' of course let'
Luke Palmer wrote:
Everything that is a Num is a Complex right?
Not according to Liskov But this is one of the standard OO
>>paradoxes, and we're hoping roles are the way out of it.
Well, everything that is a Num is a Complex in a value-typed world,
which Num and Complex are in. I do
Luke Palmer wrote:
A new development in perl 6 land that will make some folks very happy.
There is now a Set role. Among its operations are (including
parentheses):
(+) Union
(*) Intersection
(-) Difference
(<=) Subset
(<) Proper subset
(>=) Superset
(>)
other RDBMS queries.
2. Writing a true RDBMS in Perl6 will be that much easier, because now all
I'll have to do is overload these for the appropriate object types
(relation, tuple, etc) and the code for doing various things will flow
very na
way to write a set
of numbers and strings can simply be
<1 dog 42 cat 666.5>
Groovy, but what about this?
<1 dog 42 cat 42>
Maybe a warning with an optional fatality under "use strict 'sets'"?
-dave
/*
_ but not going forwards?
But that's in contrast to your saying that the epoch would be December 31,
1999 at 23:59:29.0 UTC. Or did I misread your earlier messages?
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your gu
ge people to always use one of these, then hopefully most people
will never need to care what Perl6's epoch actually _means_. It's just a
magic number you pass to some function or library.
-dave
/*===
VegGuide.Org
On Wed, 17 Aug 2005, Autrijus Tang wrote:
...This seems to be quite consistent with the rumoured US proposal to
abolish leap seconds by adding leap hours every 500 years or so:
Wow, a piece of US government policy I can actually support! Hell must be
a cold place right now.
-dave
uot;cannot find an
up-to-date leap seconds table" exception in another? Eek!
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg. My book blog
===*/
that this could be implemented by a user-provide trait like "is
transformed":
sub print_error ($color where m:i/^ [green | blue | red] $/ is transformed {
lc })
Presumably this can be done with the existing language. It doe
do these sorts of checks? I'm sure the answer is yes,
but how easy will it be? Of course, if it's implemented via a C6AN module
it's only got to be done once, but it's worth thinking about.
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg. My book blog
===*/
up at compile time, right?
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg. My book blog
===*/
On Wed, 17 Aug 2005, Dave Rolsky wrote:
Type Validation, "isa", & "can"
Params::Validate allows for several ways to check the _value_ of a parameter.
One way is to specify a primitive type like "SCALAR" or "ARRAYREF". In P6 we
have that with
On Thu, 18 Aug 2005, Autrijus Tang wrote:
On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote:
And another question. How will I make Perl6 not do automatic coercion for
me. If I have this sub:
sub date (Int +$year is required, +$month, +$day)
BTW, Pugs supports the ++ syntax
ine noise:
draw_polygon $canvas: @verticies with color => "red";
draw_polygon $canvas with color => "red": @vertices;
Dave.
If I want to parse a language that is sensitive to whitespace
indentation (e.g. Python, Haskell), how do I do it using P6 rules/grammars?
The way I'd usually handle it is to have a lexer that examines leading
whitespace and converts it into "indent" and "unindent" tokens. The
grammer can then
: the
/\h*/ match will advance the match pos, so /^^/ won't match for the
second on the same line, which would cause problems if I'm
trying to match up nested blocks.
Dave.
.numerify_if_looks_like_number,
Date => String uses .date;
Of course I'm pulling the syntax/API from my nether regions.
-dave
/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg. My book blog
===*/
Luke Palmer wrote:
Joked? Every other language that has pattern matching signatures that
I know of (that is, ML family and Prolog) uses _. Why should we break
that? IMO, it's immediately obvious what it means.
Something tells me that in signature unification, "undef" means "this
has to be un
Imagine you're writing an implementation of the unix "uniq" function:
my $prev;
for grep {defined} @in -> $x {
print $x unless defined $prev && $x eq $prev;
$prev = $x;
}
This feels clumsy. $prev seems to get in the way of what I'm trying to
say. Could we imbue optional b
Damian Conway wrote:
Rather than addition Yet Another Feature, what's wrong with just using:
for @list ¥ @list[1...] -> $curr, $next {
...
}
???
There's nothing particularly wrong with it -- just as ther's nothing
particularly wrong with any number of other "we don't need thi
xception mechanism might be a way of unifying
errors and warnings; but perhaps the opposite is true. Perhaps what we
see is a needed to generalize the distinction between warnigns and errors.
Dave.
d
@a Y @b -> ?$a, ?$b { ... } # keep going until both are exhaused
I think we still need a way to determine if an optional arg is bound.
Can the C function be used for that ("if exists $b {...}")?
Dave.
C properties get attached to a value, and are available when the
value is passed to other functions/ etc. I would like to be able to
define a property of a value that is trapped in the lexical scope where
it is defined. The example that set me thinking down this path is
sub foo( $a, ?$b = rand
1 - 100 of 496 matches
Mail list logo