of questions.
Thanks in advance for any feedback, whether they are plain answers or
pointers to where *exactly* in the Perl 6 spec I should successfully
find the answer.
-- Darren Duncan
request sound like something that would be reasonable
to do, or a bad practice to avoid?
Thank you for all the hard work you have been doing.
-- Darren Duncan
with an error.
If we're going to do what you want, we should
have some way of specifying which of the
behaviours we want using different syntax around
the rule definition.
Incidentally, I noticed that '@a = First
Second' looked a lot like the reverse of what
'$b = @a' did in Perl 5.
-- Darren Duncan
as an error. So would
applying a Rule against an undefined value produce a warning in Perl
6 or not? (A quick scan of S12 didn't say.)
-- Darren Duncan
.
Thanks to the rest of you who are working on driving Perl 6 in some
fashion; we're much better off for your contributions.
Have a good day. -- Darren Duncan
sure this didn't happen. It
is possible that there was a misunderstanding regarding the previous
question, and the default action is in fact a copy.
-- Darren Duncan
; # in any context
Eg, something that is like lines 5 and 6, but lets me explicitly use 'self'.
-- Darren Duncan
for a sub/method that specifies whether it
forces a scalar or list context?
Any opinions on this?
-- Darren Duncan
As an addendum, my idea would also apply to non-attribute variables.
If you say 'my %abc' in a method or sub, and later say 'return %abc',
then a reference to %abc will be returned by default.
So its not like I'm treating attributes differently.
-- Darren Duncan
At 3:27 PM -0800 3/17/05, Darren
, then I know how to do everything I want based on info in
the Synopsis and Larry's last comments, otherwise I still could find
out what I want to know easily enough.
-- Darren Duncan
I was just informed by IRC that 'return' propagates the context of the caller.
If that's the case, then we can just drop this discussion, problems solved.
Sorry for wasting your time.
-- Darren Duncan
At 12:07 AM -0800 3/18/05, Darren Duncan wrote:
I suppose, generally ignore most of my last
of
Perl 6 developers, and they might as well have the best possible
experience.
Assuming this request is accepted, I will post again when the
supporting version is available and/or a roadmap is known.
-- Darren Duncan
--
Date: Mon, 28 Mar 2005 14:49:47 -0800
To: [EMAIL PROTECTED
of non-scalar values should be returned by
default, and that the method must do an explicit copy if that's what
they want returned. Things are much simpler that way, and its how
Perl 5 worked. -- Darren Duncan
to remember reading somewhere that '===' will do what I
want, but I'm now having trouble finding any mention of it.
So, what is the operator for reference comparison?
Thank you. -- Darren Duncan
At 7:37 AM -0800 4/1/05, Larry Wall wrote:
On Thu, Mar 31, 2005 at 11:46:22PM -0800, Darren Duncan wrote:
: So, what is the operator for reference comparison?
The =:= operator is almost certainly what you want here.
Larry
Thanks to everyone for their answers. Last night I started coding
is good about Perl to folk who don't use it.
-- Darren Duncan
useful.
-- Darren Duncan
that form exclusively with my Perl 6 ports to date.
So in that case, the test is wrong.
-- Darren Duncan
At 8:43 PM +0200 4/20/05, Juerd wrote:
Darren Duncan skribis 2005-04-20 11:40 (-0700):
A clear way to disambiguate a block from a hash-ref when using
map/grep/sort etc is to use a colon before the leading brace for a
block rather than a space, like this:
map:{ $_ = uc $_ }
I think the best
is in an array, like this:
my %foo = map:{ ( $_ = 1 ) } @bar;
if( %foo{'abc'} ) ...
if( %foo{'def'} ) ...
if( %foo{'zrs'} ) ...
That closure is returning a pair for each array element.
-- Darren Duncan
.
It's a very good system and should be used.
-- Darren Duncan
.
On the other hand, I don't know whether or not that would be better
in practice than keeping separate interpreters for calling and called.
-- Darren Duncan
can one say it is better?
-- Darren Duncan
an alteration to
your table:
PUBLIC PRIVATE
-- --
./method() ./:method()
[EMAIL PROTECTED]() .@:method()
.method() .:method()
This looks way more consistent and predictable to me.
-- Darren Duncan
can omit the '.' on
things like $foo.[0].{'bar'}; however, the full/longer form should
always be valid syntax.
-- Darren Duncan
want, and you can run init() prior to forking without
trouble.
What I've said in this email is not exhaustive and I may add or amend
items later; but, its a good start. Feedback is welcome of course.
Thank you. -- Darren Duncan
driver names are quite short already, so its not
like abbreviations are necessary.
-- Darren Duncan
here, so do as you will.
-- Darren Duncan
for. Perl internally
just has to know about the one number.
-- Darren Duncan
application, of an
unprecedented focus and feature set, so I've thought a lot about
these sorts of issues for being the most accurate and trustworthy
possible.
-- Darren Duncan
At 3:36 PM -0700 7/5/05, Dave Whipp wrote:
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
be met by the actual DBMS that Perl + DBI needs to work with.
What you say is fair enough, but I never proposed anything impossible
or difficult; everything that I am proposing here is easy and simple.
-- Darren Duncan
.
-- Darren Duncan
At 1:22 AM -0700 7/9/05, Jonathan Leffler wrote:
On 7/4/05, Darren Duncan
mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote:
5. All details used to construct a connection handle should be
completely decomposed rather than shoved into an ungainly data
source. Examples of what should be distinct
many levels of hierarchy there can
be with a database; eg, a server has 1+ databases, each of which has
1+ catalogs (and presumably each of those has 1+ schemas and each of
those 1+ tables and other schema objects). I will probably find it
helpful when I plan various DBI-using tasks.
-- Darren
could not do with a traditional bind_param()
etc since the whole thing won't fit in RAM at once.
-- Darren Duncan
in reference
documentation?
-- Darren Duncan
,
because those specify a versioned API which continues to exist as a
wrapper. See http://arstechnica.com/reviews/os/macosx-10.4.ars/4 for
what I'm talking about.
However it's done, I'm thinking something akin to that would be good for DBI.
-- Darren Duncan
be able to port
the subclass to DBIv2, without any additional burden on DBI
developers.
I accept your challenge.
-- Darren Duncan
help it, because it
looks messy.
-- Darren Duncan
.
-- Darren Duncan
'use fatal' turned on all
the time and/or by default is also the best course of action. While
we're at it, 'use warnings' should probably be on by default too, but
this is less important than 'fatal'.
-- Darren Duncan
pair of classes is hidden behind a second pair of classes that
mediate access to them.
What are some best practices here that can be used by anyone faced by
a similar problem?
-- Darren Duncan
that conflict with anything?
-- Darren Duncan
At 3:26 PM +0100 10/22/05, Nicholas Clark wrote:
At the risk of re-enforcing my apparent optimism.
On Thu, Oct 20, 2005 at 04:02:10PM -0700, Darren Duncan wrote:
that the next best one to exploit is ยค (euro;
unicode=20AC; utf8=E282AC), and the next best is
Woah. You've just demonstrated
but with appropriately different syntax:
['a','b'] ~ ['c','d']
But that it returns ['ac','ad','bc','bd'] rather than ['ac','bd'].
So is there a similarly terse way to do combinations already, and if
not then would you consider it commonly used enough to add?
-- Darren Duncan
variable before passing it to a subroutine just because that sub
*may* have its own try block ... a caller shouldn't have to know
about the implementation of what it called.
I welcome feedback on this issue and a positive, elegant resolution.
-- Darren Duncan
databases. Though I anticipate that one could extend or override
built-ins so that they interact with remote databases instead of
internal variables, such as with the concept of sub-classing or role
reusing or tying.
Thank you. -- Darren Duncan
At 2:54 AM + 12/15/05, Luke Palmer wrote:
On 12/15/05, Darren Duncan [EMAIL PROTECTED] wrote:
I propose, perhaps redundantly, that Perl 6 include a complete set of
native
Okay, I'm with you here. Just please stop saying native and core.
Everyone.
Yes, of course. What I meant
much of telling Perl how to do the job.
I don't want to have to use maps or greps or whatever, to express the
various relational operations.
-- Darren Duncan
thing is more low
level and very pervasive, not to mention quite simple to fix.
-- Darren Duncan
)
$x == 3; # like random_one($x) == 3
The odds of two undefined values in such primitive data types being
equal is 1/Inf, which is zero.
So no 2 undefs are equal, and no undef is equal to a defined value.
You can't say what an undef equals because you don't know what value it has.
-- Darren
At 10:07 PM -0800 12/16/05, chromatic wrote:
On Friday 16 December 2005 18:15, Darren Duncan wrote:
0. An undefined value should never magically change into a defined
value, at least by default.
This is fairly well at odds with the principle that users shouldn't have to
bear the burden
toward, in my mind.
If you see 'never-assigned' and 'assigned-but-unset' to be distinct
in practical use, then maybe we need to add a method/property to all
containers that is used like .defined(), such as .unassigned() ...
but I can't say its needed.
-- Darren Duncan
At 9:30 AM + 12/17/05, Luke Palmer wrote:
On 12/17/05, Darren Duncan [EMAIL PROTECTED] wrote:
Undef, by definition, is different from and non-equal to everything
else, both any defined value, and other undefs.
You said by definition, but where is this definition?
Maybe definition
, but hopefully I dealt
with the worst ones from the preceeding first draft.
-- Darren Duncan
$module_name;;
die if $!;
... as I do now.
I like to save string evals for when I'm actually using arbitrary
runtime generated Perl code which is in a variable.
-- Darren Duncan
First of all, I concede that features like autovivification and
undefs defaulting to the domain-qualified 'none' are fine as what
Perl does by default, so I retract any request to change this; I am
fine for these things to remain as they are and were.
-- Darren Duncan
P.S. FYI, permit me
Following the discussions from 2 weeks ago, are there any plans to
update the synopsis soon regarding the $! variable? Synopsis 2 still
says that it is conjectural to whether $! is always environmental.
Thanks. -- Darren Duncan
as the advantage of fewer changes of Perl 5 to Perl 6 porters.
-- Darren Duncan
At 3:40 PM +0100 12/22/05, Michele Dondi wrote:
On Thu, 22 Dec 2005, Darren Duncan wrote:
On a separate but related matter, I'm in the position of wanting to
do something unusual, which is create a data file format whose
content is executable perl code that defines a data structure, a
hash
types is to get bleeding edge
maximum performance, and abstraction would take away from this then,
maybe. Or maybe not. But if anything bleeds through, it should be
the hardware, and not other programming languages.
-- Darren Duncan
classes can override.
Part way through writing this, I had a brief chat on #perl6 with
stevan (and apparently the meta-model is still quite in flux) and he
said my question was related to Larry's class but undef idea, and
that Larry should talk more about the subject.
Thank you. -- Darren
At 3:02 PM +0800 2/6/06, Audrey Tang wrote:
On 2/6/06, Darren Duncan [EMAIL PROTECTED] wrote:
Speaking briefly, I would like it if Perl 6 provided a way for a
class (or role, or meta-class, etc) to declare that all variables
declared to be of that type are automatically/implicitly set
to ensure useable
characters without name collisions, and that makes the resulting code
obfuscated and hard to understand; I don't want to obfuscate.
Thank you. -- Darren Duncan
testing, so I think I'll have to check that a test for the feature
exists, and add one if not.
-- Darren Duncan
universal currency. I suggest gold.
So every relevant symbol name could start with
'Au' instead of '$', and an advantage of this is
that it is still easy to type on any keyboard.
-- Darren Duncan
are improvements. -- Darren Duncan
6 itself, while Rosetta is
a third-party toolkit for application building.
-- Darren Duncan
, it could potentially be named
MutableSet, though that would break the pattern of built-in types
having one-word names, but I haven't thought of any alternatives so
far.
Thank you. -- Darren Duncan
and
saying that some are atomic while others aren't.
-- Darren Duncan
in advance.
-- Darren Duncan
and fast to do any common type of work with it, and
relational algebra is an extremely common kind of work being done.
-- Darren Duncan
Actually, I'll add a few more things to my reply, which should be helpful ...
At 5:11 PM -0700 5/4/06, Darren Duncan wrote:
At 10:51 AM +1200 5/5/06, Sam Vilain wrote:
Moreover, the Relation type has these
operators that the Set type doesn't have: rename(), project(),
restrict(), extend
Relation class
in Pugs' ext/Relation/ directory for demonstration purposes and
evaluate changes later.
-- Darren Duncan
about them.
Thank you. -- Darren Duncan
. (Similarly, a Relation is
explicitly discrete and finite by definition.)
I assume you aren't referring to the temporal specific thing called
an interval.
-- Darren Duncan
for.
-- Darren Duncan
. Temporal or
spacial data in common use today is just too complicated and
non-generic, I think.
(Whereas, the existing built-ins, and relations, are very generic and simple.)
-- Darren Duncan
{ all( .items ).does(Real) };
-- Darren Duncan
At 6:06 PM -0700 5/6/06, Darren Duncan wrote:
You can do it simply, kind of like this:
class Point { has Real $x; has Real $y; };
subset Interval of Range where { all( .items ).does(Real) };
Er, you should read 'Real' as 'Num' (I originally meant Rational,
which no longer exists
they would work, or alternately please replace 'Bag' with 'Seq'.
Thank you. -- Darren Duncan
Er, I meant to say subtracted where I said added. -- Darren Duncan
At 4:11 PM +1200 5/23/06, Sam Vilain wrote:
Darren Duncan wrote:
$bag1 - 1; # Bag(2,7,[1,Seq(8,2)],7)
$bag2 - (1,1,1,1); # probably the same
$bag3 - (1,1,2,1); # ?
Bag's won't .does(Array) or .does(Coll[Seq,...]), so that hyperoperator
won't work - if anything
sure the self syntax is invalid.
Moreover, S12 explicitly says that Perl 6 has no barewords, save
package names in specific circumstances.
-- Darren Duncan
At 1:45 PM +1000 5/29/06, Stuart Cook wrote:
On 5/29/06, Darren Duncan [EMAIL PROTECTED] wrote:
There are many places where the bareword self is used, whereas I
believe the current syntax is $?SELF for the same thing, and has
been for awhile.
Actually, I seem to recall `self` being accepted
there
is just a single process with a single thread.
-- Darren Duncan
completion before it
returns control, the invoker should know that vs when completion is
guaranteed.
In other words, an invoker of an op should know whether the op is
ACID compliant in all parts of its operation or not.
-- Darren Duncan
to be
operating like a C enum, where every value corresponds to a native
integer, so perhaps buf is more appropriate. Or alternately, we
should see Int and Str here.
-- Darren Duncan
as members?
9. If you declare a parameter of a type that does Foo, and you pass
an argument that is a different type that does Foo, but neither of
them is of type Foo, will the compiler accept the binding (though it
may fail at runtime)?
Thanks. -- Darren Duncan
of a string-join. -- Darren
Duncan
At 6:25 PM -0700 7/8/06, Darren Duncan wrote:
At 8:32 PM -0400 7/8/06, Joe Gottman wrote:
I have one minor comment about join. You should specify its behavior when
it is passed an empty list. Does it return undef or the empty string?
I think it makes the most sense for it to return an empty
working with hash
keys.
I may have forgotten to raise something else, but there's that for now.
-- Darren Duncan
to the immutability, and all objects of the same
class would be the same in that respect. Incidentally, your Currency
example would likely be an immutable type. -- Darren Duncan
having negated versions of all these various types of
equality tests. Eg, !== for ===, nev for eqv, etc. They would be
used very frequently, I believe (and I have even tried to do so), and
of course we get the nice parity.
-- Darren Duncan
I think that Jonathan meant for his reply to my message to go to the
list, so I am including it in its entirety, in my reply.
At 11:23 PM -0700 7/13/06, Jonathan Lang wrote:
Darren Duncan wrote:
Jonathan Lang wrote:
So the purpose of === is to provide a means of comparison that doesn't
. The above-stated rule would still stand for any resources
managed by Perl itself.)
-- Darren Duncan
At 12:30 AM -0700 7/14/06, Darren Duncan wrote:
If $a === $b means what I think it does, then I believe that a
not-premature implementation optimization of === would be that it
always $a := $b if it was returning true, so that any future === of
$a and $b or aliases thereof could short-circuit
At 9:22 AM -0700 7/14/06, Dave Whipp wrote:
Darren Duncan wrote:
Assuming that all elements of $a and $b are
themselves immutable to all levels of
recursion, === then does a full deep copy like
eqv. If at any level we get a mutable object,
then at that point it turns into =:= (a trivial
, the result is the
same. So you can use whichever order you want without it needing to
be coded for. -- Darren Duncan
1 - 100 of 444 matches
Mail list logo