$_.} };
Whereas, the "restrict" is like a grep; eg:
my @restriction = @original.grep:{ $_.{'a'} eq 'foo' };
Suffice it to say that, along those lines, there are 4 terms.
The actual syntax of RM "restrict" is more like "grep" than the other 3.
But that doesn't have to matter for us. We don't have to use the
same words as domain-specific languages to name an operation, but a
name that works well in english is very helpful.
-- Darren Duncan
his isn't causing another homonym problem, ...
How about "pass" as a new name; eg:
@filtered = @original.pass:{ };
I don't think that this in any way suggests modifying the original.
-- Darren Duncan
possible.
And in fact, I expect that PBP was written to be forward compatible
to Perl 6, as it could describe styles that should be natural in Perl
6, even if less so in Perl 5.
-- Darren Duncan
implement the Junction in the first place, we
can't use all/any/one/none etc in the definition.
-- Darren Duncan
At 8:13 PM +1200 9/26/06, Sam Vilain wrote:
Darren Duncan wrote:
> Within a system that already has an underlying
set-like type, the Junction in this case, a test
for uniqueness is (pardon any spelling):
all(@items).elements.size === @items.size
The all() will strip any duplicates,
27;m looking for).
An archive for many Perl mailing lists already exists at:
http://www.nntp.perl.org/group/
You should be able to use this to seed yours.
-- Darren Duncan
At 4:08 PM +0200 10/10/06, TSa wrote:
HaloO,
Darren Duncan wrote:
Within a system that already has an underlying set-like type, the
Junction in this case, a test for uniqueness is (pardon any
spelling):
all(@items).elements.size === @items.size
The all() will strip any duplicates, so if
class is immutable, and add_vertex() will create and
return a new Polygon object with those properties, and the original
is still the Rectangle.
-- Darren Duncan
rt first or last. I don't see the reduce
meta-operator as being applicable to this, since reducing using
less-than eg, will return a boolean result. Unlike, say, 'avg' or
'sum', 'min' and 'max' are conceptually generic to all ordinal types.
So, is this workable?
-- Darren Duncan
ally can .does(), and only those have <, >, <=, >=, <=>, min,
max, sort, etc, there is the question about how to handle types that
don't .does() Ordinal in some generic situations. Either they fail,
or there is some sort of fallback provided by Object, such as they
end up sorting on their memory addresses; but in the latter case, we
don't need an Ordinal role because every type will be doing it in
some fashion or other due to Object's defaults.
Tangentially related, I'd like to suggest that the negation
meta-operator be generalized from comparison operators to any binary
operator that returns a boolean value (or possibly even to any
operator that returns a boolean value, so that '!?$x' would mean
"coerce to boolean, then negate its value").
If I'm not mistaken, the negation meta-operator already does this.
-- Darren Duncan
ty.
4. Eliminate the alphabet soup and related ugliness.
5. Better huffman coding because most people will
want to sort their values by their native types;
people normally want to sort Str as Str and Num
as Num, and plain == etc will do that. I don't
see any use of weak types as reducing the
benefits either.
6. In my mind, bit shifting is a less commonly
coded activity, so making those ops a bit longer
shouldn't hurt anything.
-- Darren Duncan
it.
5. It would help simplify my implementation tasks if all the built-in
Perl 6 types had multis for their operators such that the operators
could all be invoked exclusively with named arguments, even if there
is just 1 argument. Though if you don't want to do this, then its
not a big deal, and I'll just subclass them with wrappers that do
provide such.
Thank you in advance for any consideration or feedback.
-- Darren Duncan
At 11:00 AM -0500 11/13/06, Mark J. Reed wrote:
On 11/13/06, Darren Duncan <[EMAIL PROTECTED]> wrote:
- There are no Undef or NaN etc values or variables.
A RDBMS language with no "null" would seem to be problematic..
although i guess you could just use 1-tuples where th
At 11:24 PM + 11/13/06, Smylers wrote:
Darren Duncan writes:
> 1. I'm not sure if it is possible yet, but like Haskell et al ..., it
should be possible to write a Perl 6 routine or program in a pure
functional notation or paradigm, such that the entire routine body is
tes. Once again, you can then
compare the value lists of 2 Hashes set without
sorting them. Still, regardless of what you do
here, making .keys return a Set should be done.
-- Darren Duncan
?
Repeat again with Bag->Seq.
In my mind, it would be far simpler to reserve such operators to the
Set only, and cast a Bag|Seq as a Set to use them on it, if that is
desired whereupon the results are all distinct.
But still, it is something that should be decided on, one way or the other.
-- Darren Duncan
);
# Bag(2,3,3) or Bag(3,3) ?
Bag(1,2,2,2,3,3) d_union Bag(1,2,2,4,4);
# Bag(2,3,3,4,4) or Bag(3,3,4,4) ?
Repeat again with Bag->Seq.
In my mind, it would be far simpler to reserve such operators to the
Set only, and cast a Bag|Seq as a Set to use them on it, if that is
desired whereupon the results are all distinct.
But still, it is something that should be decided on, one way or the other.
-- Darren Duncan
dered disjoint_union to mean exactly the same thing as
symmetric_difference, meaning an analogy to XOR. Still, Wikipedia
says they are different, and its
http://en.wikipedia.org/wiki/Symmetric_difference article describes
the meaning I had been attributing to both. So what I was really
asking was:
Bag(1,2,2,2,3,3) symmetric_difference Bag(1,2,2,4,4);
# Bag(2,3,3,4,4) or Bag(3,3,4,4) ?
-- Darren Duncan
f the value of that Num is a whole number.
So taking the semantics of Int vs Num that users see as examples for
how Set vs Bag semantics should work, as far as argument and result
types go, makes a lot of sense, and is easily to implement with Perl
6 multis.
-- Darren Duncan
would be
too.
-- Darren Duncan
mple stand-in for some arbitrary user-defined type. -- Darren
Duncan
accounts for many
aspects of the relevant problem space. -- Darren Duncan
pped
when mixed Set Bag (x) ops are used. This is where I started before
Darren mentioned the Set <: Bag fact.
Is that enough food for thought for later in the day?
Tsa,
I consider the current KeyHash|KeySet|KeyBag|Set|Bag etc in Synopsis
6 to be a good solution for users of sets and bags.
I d
he difference of semantics would be the
same as with the Hash; a %foo = %bar would copy all the elements,
while $foo = $bar would not.
-- Darren Duncan
/Int::Mod/Num::Div/Num::Mod instead), but I hope you get the
point of what I was saying.
-- Darren Duncan
dle *everything* with the
language.
Really, dealing with non-integer numbers properly deserves,
conceptually or actually, a separate component or several just for
them, as per unix philosophy of dedicated pieces doing what they do
well.
I hope this proposal makes sense.
-- Darren Duncan
"avoid bloat", but give it its own space.
I hope that helps.
-- Darren Duncan
At 9:57 PM -0700 1/4/07, Doug McNutt wrote:
At 18:23 -0800 1/4/07, Dave Whipp wrote:
Darren Duncan wrote:
For example, the extra space of putting them aside will let us
expand them to make them more thorough, such as dealing well with
exact vs inexact, fixed vs infinite length, fuzzy or
section mention Superset as it does Subset,
like the top quoted section already does with this update?
-- Darren Duncan
the reverse. This
is all assuming that the purpose of .does is to indicate when values
of one type can be substituted for values of another type.
Similarly, if there is no .does relationship between Int|Num and Str,
due to what .does is actually for, then there shouldn't be one
between Int and Num.
-- Darren Duncan
At 12:32 AM + 1/23/07, Smylers wrote:
Darren Duncan writes:
For round-trip consistency, a generic non-formatted num-to-char-string
operation should include a .0 as appropriate if it is converting from
a Num, whereas when converting from an Int it would not.
So this (in Perl 5
perl() produces some long-hand like "Int(1)"
or "Num(1)", then it won't matter whether it is "Num(1)" or
"Num(1.0)" etc.
-- Darren Duncan
cause
explicit chunking.
Eg, smooth:
map { $_, $_ * 10 }, 1..3
Vs chunky:
map { [$_, $_ * 10] }, 1..3
-- Darren Duncan
, people should be able to call floor() etc explicitly if
they want to make their Num->Int conversions explicit rather than
implicit. -- Darren Duncan
s, and is easy to learn
for both Perl 5 people and people coming from other languages.
Also importantly, it should prevent common types of errors.
If being more terse is important, you could further abbreviate .head
and .tail, but the main point is that a plain -N array index never
means count from the end.
-- Darren Duncan
e or less it.
Its possible that additional operators may be useful, but I haven't
thought them through yet. (Also, some relational operators don't
make sense just applied to individual tuples, and so they aren't
mentioned above.)
Any feedback is appreciated. Including both appropriate names for
the semantics of the operators I mentioned, and/or comparably very
concise syntax for doing the same with existing Perl 6 operators.
Thank you. -- Darren Duncan
;t even look the same visually.
But once again, the functions|operators can have different names.
At 6:22 PM + 2/27/07, Smylers wrote:
Darren Duncan writes:
> I believe that ... some common relational operations would be a lot
easier to express if Perl 6 had a few more operators that ma
said, I suspect
that either a wraparound or an overflow code is what you'd get, and
not a type upgrade. -- Darren Duncan
e numeric-casting == will do what you want either.
-- Darren Duncan
P.S. Sorry for not replying to this for so long, but I have been without
a computer for the last week ... and possibly for the next week too ...
right now, I'm on someone else's machine.
--
On Wed, 7 Mar 2007, Smylers wrote:
> On February 27th Darren Duncan writes:
&
errors,
similar to referencing an undeclared symbol name.
Or maybe have separate versions for strict or non-strict behaviour, or a
pragma that toggles such, as is appropriate.
-- Darren Duncan
So if a short-hand syntax
existed, it would be replacing more complicated code than that. -- Darren
Duncan
at that project will help to explain a lot
of what I'm trying to get at more than my own explanations, probably.
-- Darren Duncan
f
+the infix operator will be the variable's prototype object:
Typo: "instea dof" instead of "instead of".
I didn't notice any other unresolved typos in the last 2 weeks' worth
of synopsis updates.
-- Darren Duncan
k are not the
same thing?
-- Darren Duncan
Sweet candy! I might actually be able to start executing some of my
code! Will try any day now. -- Darren Duncan
At 8:48 AM +0800 5/11/05, Autrijus Tang wrote:
This works:
rule name { Larry | Matz | Guido }
rule project { Perl | Ruby | Python }
rule description { \s does \s
a global var in the caller-most Perl5, it will
be visible in the called-most Perl5, or vice-versa.
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
#x27;.
And the space character is really a rather arbitrary looking value
for a default and is equally valid with, say, the line break, so how
can one say it is better?
-- Darren Duncan
is discussion, and I *like*
that ':' public vs private consistency, so here's 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
agree and would accept $:bar *if* it were officially an
abbreviation, as you suggest, just like one can omit the '.' on
things like $foo.[0].{'bar'}; however, the full/longer form should
always be valid syntax.
-- Darren Duncan
;
$sth3.execute( { foo => 'blarch' } );
};
$! and say "dag nabit!";
$self.db.close();
};
$! and say "dog gone!";
}
In the above example, only main() actually invokes a database; init()
does load the DBI driver, though. You can also invoke main() as many
times as you 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
t; 'DBD::Template', },
tmplss_ => { class => 'DBD::TemplateSS', },
tuber_ => { class => 'DBD::Tuber',},
uni_ => { class => 'DBD::Unify',},
xbase_ => { class => 'DBD::XBase',},
xl_ => { class => 'DBD::Excel',},
yaswi_ => { class => 'DBD::Yaswi',},
};
I mean, what's up with that? I assume DBI 1 has this for legacy app
backwards compatability, but DBI version 2 should never have to
accomodate such abhorrent computer programming practices in its core.
By having users specify the full driver class name, DBI won't have to
do any such explicit mapping.
By the way, most driver names are quite short already, so its not
like abbreviations are necessary.
-- Darren Duncan
nk that having the standard
driver namespace being outside DBI::* is an antiquated notion that
bears little resemblence to what is standard in most frameworks. All
this said, I'm not stuck on a change here, so do as you will.
-- Darren Duncan
es are good for. Perl internally
just has to know about the one number.
-- Darren Duncan
work cut for them.
BTW, my main programming project (unreleased) is a
genealogy/history/anything database type 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 is an
bly all-singing and all-dancing,
but no-one can write a driver for it because the requirements cannot
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
Perl 6 is, so we have to consider things that are reasonable
for inclusion; even if it isn't common for native database support
now, that isn't to say that native support won't come later, and when
it does, we'll already be ready, or they'll even take what DBI does
as a cue for what they can add.
-- 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". Exam
how
you set up your systems, and how 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 pla
s or various
types.
I second that. Have API methods for fetching or storing by-the-chunk
pieces of LOBs that one could not do with a traditional bind_param()
etc since the whole thing won't fit in RAM at once.
-- Darren Duncan
me from, so I can correlate them in reference
documentation?
-- Darren Duncan
any applications or drivers,
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
ve implemented the subclass, you'll have empirical proof
of the feasibility, and, more importantly, you'll be able to port
the subclass to DBIv2, without any additional burden on DBI
developers.
I accept your challenge.
-- Darren Duncan
27;use perl5:DBI' or something like that (you may
need to explicitly build Pugs with Perl 5 linked in, for that to
work). Then you just have to update the rest of your code to be good
Perl 6. Lots of examples exist now with Pugs. -- Darren Duncan
ar there, since Scalar seems too
specific. Likewise with NonJunction, if we can help it, because it
looks messy.
-- Darren Duncan
o -> $x {...} to be a Junction. Maybe the $x
should just be an Any and be done with it.
-- Darren Duncan
te project.
-- Darren Duncan
x27; turned on all the time
and/or being the default, likewise having '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
2005-09-30 Darren Duncan <[EMAIL PROTECTED]>
--
I would like to acknowledge that, despite all the good things that
have come out of it, I have had some significant problems in regards
to the past development of my Rosetta rigorous da
and
instead expect users to create objects that wrap the others instead
of subclassing them?
Assume also that it may be counter-productive for one class to expect
user code to invoke the second class on its behalf, such as if when
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
27;::' and
'$':
:$:
Does 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 demonst
es provide
this, and is cited in Perl Best Practices as
doing so also. -- Darren Duncan
hand, perhaps something I actually want is something
like the hyper-operation 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
wise not show up 'til later?
4. I'm also interested on documentation for writing Parrot extensions, as well as
making bindings to the various languages that compile to Parrot bytecode. However, I
won't make that an official request as I should RTFM first, so I will do some online
se
be pretty ideal
> for checking the results and reporting the proper errors.
I assume you're asking this because you have a good reason to not use
something like mon or cricket, right?
(darren)
- --
Optimization hinders evolution.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (G
there any
> IDE out there that highlights POD differently than code?
vim Does the Right Thing. Screenshots available upon request. ;)
(darren)
- --
Wise people think all they say; fools say all they think.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: This message i
eleased to CPAN now, is
there an already planned method for those distros to say the right
things in their Makefile.PL so that the existing automated CPAN
testers network can know to run them through Pugs? Or do we just
have to skip automated tests for now?
Thanks for any feedback and directions.
-- Darren Duncan
concerning issues of CPAN handling
of Perl 6 modules and the best way to organize the Perl 6 module name
space. But those comments will go in a different email thread, due
on p6c within an hour or so.
Thank you. -- Darren Duncan
the first Locale::KeyedText for Perl
6 in a few days.
-- Darren Duncan
of, so they are still in Perl 5.
I will research and fix the bugs over time. Or anyone else with Pugs
commit privileges is free to do so.
Have a good day. -- Darren Duncan
P.S. The test suite for the Perl 5 version was not translated; this
will be done later around when Pugs supports the necessa
At 9:54 AM -0500 3/8/05, Stevan Little wrote:
On Mar 8, 2005, at 2:56 AM, Darren Duncan wrote:
I have just committed the first Perl 6 port of Locale::KeyedText
within the Pugs distro, as was the recommended course of action in
contrast to releasing to CPAN. This is the very first normal and
esults get sorted? Or
alternately, will hashes always serialize in the same order on all
platforms, unlike in Perl 5 where its pairs come out in an apparently
random order? If not, I will have to continue to do manually what
as() does.
Okay, that's it for my initial set 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
directly as if they were public. Both
classes have their own set of methods that outside code can invoke
directly, and each kind of object can be held by external code.
Also, does my 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
First
Second"' looked a lot like the reverse of what
'$b = "@a"' did in Perl 5.
-- Darren Duncan
n interface ala
the 'DBI' core module. Or maybe 'Role' is the wrong word.
Essentially it is an interface definition.
-- Darren Duncan
t Perl 6 still treats the use of
undefined values other than in boolean context 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
on driving Perl 6 in some
fashion; we're much better off for your contributions.
Have a good day. -- Darren Duncan
ask
being done correctly.
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
with Pugs/Perl6?
I would say that truncation is what should happen, as with Perl 5,
unless Larry explicitly changed it to do rounding with Perl 6.
Generally speaking, any behaviour should be the same as Perl 5 unless
explicitly said to be different. -- Darren Duncan
provided significant help to a committer, such as by providing
helpful suggestions or bug reports, they should be in it too (the
file's header says so).
-- Darren Duncan
I can't promise a fully correct solution, since I'm not familiar with
this module yet, but I can at least do a large chunk of the
translation on this module, and do it quickly. -- Darren Duncan
At 1:09 AM +1100 3/14/05, Adam Kennedy wrote:
At the request of Autrijus, I've just
al checkin of the
Perl 5 code.
I made very few other changes in this commit (just #! and etc), and I
made them prior to discovering the linebreak problems. Since any
further changes will be a separate commit, it will be easier to see
what changes were made between versions.
-- Darren Duncan
either do or don't want to be modifiable by calling code.
Separate question, just to confirm, I assume that plain '=' always does a copy?
Thank you for any clarification.
-- Darren Duncan
ault. I wanted to make 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
n any context
return %:baz; # in any context
Eg, something that is like lines 5 and 6, but lets me explicitly use 'self'.
-- Darren Duncan
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
te?
If it does, 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
101 - 200 of 632 matches
Mail list logo