Carl Mäsak wrote:
Darren (>):
Bit
Blob
Set
Bag
Mapping
How does one write anonymous value literals of those types? And I mean
directly, not by writing a literal of some other type and using a conversion
function to derive the above?
Why is the latter method insufficient for your ne
Daniel Ruoso wrote:
Em Seg, 2008-12-01 às 18:21 -0800, Darren Duncan escreveu:
I'm wondering how to write anonymous value literals of some Perl 6 basic types,
and I didn't see mention of this in synopsis 2.
Getting away from your question entirely, I think the issue here is that
wh
(.bits is styled like .codes|.graphs etc of Str).
Bit is certainly not a replacement for Bool. If only one stays then Bool needs
to stay.
-- Darren Duncan
TSa wrote:
Darren Duncan wrote:
Strong typing in Perl means that Perl is conveniently and reliably
keeping track of this user-intended interpretation of the data, so it
is easy for any piece of code to act on it in a reasonable way.
Strong typing lets user code be clean and understandable as
,etc:name«val1 'val 2' etc»
--name :name# only if declared Bool
--name=value :name # don't care
Is that right? Should the right column example not also be shortened to :n ? I
thought the single-dash names only allowed a single character in a name on
purpose, since multiple chars after a - were multiple options. -- Darren Duncan
differ? -- Darren Duncan
all differences from
the self-hosted shared one are in separate files.
So have I made any sense here, and what do you think?
-- Darren Duncan
this back on topic, the large amount of Muldis D built-ins
written in that language are analogous to the Perl 6 Prelude. As long as the
Perl 6 Prelude is written in sufficiently high-level a fashion, it should be
effectively reusable.
-- Darren Duncan
Jon Lang wrote:
Forgive my ignorance, but what is a Prelude?
The Prelude is a file written in Perl 6 that defines some Perl 6 built-ins.
See http://perlcabal.org/svn/pugs/view/src/perl6/Prelude.pm for what AFAIK is
the newest version.
-- Darren Duncan
r to share code between Perl 6
implementations, where each implementation wants to use it. Or just to take
advantage of the fact that Perl 6 itself should be easier to write some kinds of
code in than other languages, including itself. We can go further than the
minimal bit we have now.
-- Darren Duncan
pproximate / precision-varying terms, and so each underlying
implementation can easily interpret this as an exact math operation if it is
itself capable of exact math, and otherwise it still has enough information to
know how to do it in approximate math.
-- Darren Duncan
Dave Whipp wrote:
Darren Duncan wrote:
Dave Whipp wrote:
sub sqrt(Num where { 0 <= $_ <= Real::Max } $x) {
(0..$x/2 :by(Real::Epsilon)).min: { abs $x - $^candidate ** 2 }
}
So do you really mean "as declarative a manner as possible"? Or would
you consider this exam
much as possible (e.g. prefer hyper-ops
over explicit loops)
Yes, I agree; what you stated in the second paragraph here is what I considered
important for a prelude.pm. -- Darren Duncan
mutator to the clone instead, then return the clone". Now maybe something
like this already exists, but conceptually it would be the opposite of the op=
metasyntax.
Anyway, those are some thoughts I have.
-- Darren Duncan
ew
exceptions ... I could be wrong on that point.
-- Darren Duncan
Larry Wall wrote:
On Fri, Jan 30, 2009 at 03:30:02AM -0800, Darren Duncan wrote:
What's with this NFG / Normal Form G that you refer to? I don't see any
mention of that in http://unicode.org/reports/tr15/ ... did you mean NFC?
Nope, this is a Perl/Parrot idea. It started out wit
ain markings and restrictions as I mention, this can work in Perl.
-- Darren Duncan
t that one. Actually, doesn't Haskell have co-routines,
or am I mistaken; how does Haskell do laziness relative to thoughts for Perl 6?
-- Darren Duncan
the 'is pure' trait on its parameters and
on itself.
I will note that my definition of purity also includes being deterministic,
isolated, and effectively atomic. I would consider a printout to be a side
effect that strictly speaking wouldn't belong in a pure system. However, having
a printout strictly for the purposes of debugging is okay.
-- Darren Duncan
ure functions and handling side
effects or what have you.
After that Set::Relation is improved, then Muldis::Rosetta would then be
implemented, doing that on a larger scale.
-- Darren Duncan
e conversions with strings, but
it has the foundation on which such could be built. And yours doesn't have to
be the same of course.
-- Darren Duncan
Timothy S. Nelson wrote:
On Tue, 17 Feb 2009, Darren Duncan wrote:
Second of all, I think a more generic term than DateTime should be
used to name an object that represents an instant in time; for example
I suggest calling it "Instant". The name "Instant" fits in a lot
b
follow soon.
Thank you. -- Darren Duncan
Darren Duncan wrote:
Presumably the other enhancements we discussed like using the 'Instant'
name will follow soon.
Well, I spoke too quickly; its already done with r25405; good start there. --
Darren Duncan
ut just means "don't know" and
not recurring.
But a dedicated Recurring is definitely useful since it can specify other kinds
of recurrings, like "every 90 minutes from X Instant" for example, and it
unambiguously means recurring rather than don't know.
-- Darren Duncan
Timothy S. Nelson wrote:
On Thu, 19 Feb 2009, Darren Duncan wrote:
You could make month/day into positive integers or "subtype of Int
where 1..12" etc, though it isn't strictly necessary. Leave year as
Int of course, since at least in the proleptic Gregorian etc you can
ha
hing.
So please provide all 4 roles, that's what I strongly support.
-- Darren Duncan
P.S. I will be away from a computer during Fri-Sun and much of today too so if
I don't chime in then it is not due to disinterest.
Dave Rolsky wrote:
On Thu, 19 Feb 2009, Darren Duncan wrote:
And which is why subsecond and whole-second *can* be combined.
Appropriate separation allows better accuracy in letting people
express what they mean rather than shoehorning it into a less accurate
space, like DateTime.pm shoehorns
Dave Rolsky wrote:
On Thu, 19 Feb 2009, Darren Duncan wrote:
So something like that. So Date and Time mean all Date|Time details,
and DateTime means all details of both. And Instant means any
combination of defined or not of said member attributes. And that's
actually why I advo
Darren Duncan wrote:
Dave Rolsky wrote:
It's not necessary to store each unit internally in order to get
everything right, and not doing so makes some things a lot easier
(though it makes other things harder ;)
I prefer to make value representation simpler at the possible co
econds being a
non-integer) etc. I'm inclined to prefer the latter since that is more
future-proofed (a specified date+time that is in the future won't change on you
between storage and retrieval with persistent memory).
-- Darren Duncan
onship to integers apart from cultural artifacts.
Let's keep our integers in the libraries, not in the fundamental
definition of what "now" and "then" mean.
Yep, couldn't agree more.
-- Darren Duncan
Darren Duncan wrote on 2009 Feb 17:
Timothy S. Nelson wrote:
Agreed, and that's kinda what I'm doing. But I still think
there's room for improvement. I'll try and design an API that does
what DateTime does, but:
Talking about dates and times, I have some suggestion
this could be
customizable (eg, an overlap if the ordered type is discrete like Int, and an
adjacency if it is continuous like Rat|Num) unless there are general rules best
applied generally. I cite the "comparing inexact values" for prior discussion
of these matters, that don't necessarily need repeating.
-- Darren Duncan
t any/all/etc this also means that
junctions would have to work with the non-enumerable set. -- Darren Duncan
Jon Lang wrote:
Darren Duncan wrote:
I was thinking that Perl 6 ought to have a generic interval type that is
conceptually like Range, in that it is defined using a pair of values
he
documentation for that routine, I suppose. Whatever it was, it sounded useful
at the time. -- Darren Duncan
e them; this could help performance if hashing or determining element
identity is expensive and potentially never needs doing. I plan to demonstrate
this as part of my next major Set::Relation module reimplementation, in a few
weeks, though I don't expect a demonstration is necessarily required
Jon Lang wrote:
Darren Duncan wrote:
What I'm proposing here in the general case, is a generic collection type,
"Interval" say, that can represent a discontinuous interval of an ordered
type. A simple way of defining such a type is that it is a "Set of Pair of
Ordered"
s enveloping self)", but keep in mind that
it should work if the parameters in question are named instead. Then one could
invoke it with say "$r1.natural_join( [$r2, $r3] )" or some such.
I'm thinking maybe there was an answer to this in Synopsis 6 but I didn't see
it.
Thank you. -- Darren Duncan
Darren Duncan wrote:
So, is there some way, or is it reasonable for there to be, to declare a
method in Perl 6 such that say it is declared with say an Array of R or
Set of R etc parameter and that parameter is marked somehow, maybe with
a trait, to say it automatically gains the invocant as
for the language to care
about is just that information about a Rat in terms of Ints can be extracted in
either format.
-- Darren Duncan
would provide a good way to tie in
the parrot logo with various languages implemented on Parrot. Sits
nicely with the "Speaks you language" tag line.
What do people think?
I think that idea has promise, and I would be happy with it sans something
better coming along. -- Darren Duncan
Str
isn't likely to be that flexible then I'd like to know for my planning purposes.
Thank you. -- Darren Duncan
Actually, never mind. For my purposes, I'll just pretend that Str is that
flexible, since going beyond the Unicode range is more of an academic
possibility than something likely to happen much in real use. Or if it does
happen, I'll adapt later. So no need to reply. Thank you.
re be more confident that it is safe to use some optimizations.
-- Darren Duncan
27;use 5' lines say. See Synopsis 1 (
http://perlcabal.org/syn/S01.html ), which talks about this. --
Darren Duncan
At 12:14 AM +0300 1/5/08, Richard Hainsworth wrote:
Perl scripts have had the extension *.pl
To distinguish the scripts I started writing in perl6 from those in
the same d
y are very simple. But really, you know better to make
this call yourself, having more information on your circumstances.
-- Darren Duncan
P.S. Does anyone think that the main part of this email may provide
a starting point for a general best practices tutorial item or
Perl.com article?
27;nfd_codes' etc.
I'm glad to see, from your latest post, that this is how Perl 6
actually works as well. That .codes specifically works in terms of a
particular normal-form (either a specified one or a default one)
rather than the current implementation, and so makes this aspect of
Perl 6 a lot more deterministic while portable.
-- Darren Duncan
hows the numify in the order [-1,0,1], but the
Order values are not in the corresponding sequence.
To fix the problem, the S29 text should probably say:
returns |Order::Increase|, |Order::Same|, or |Order::Decrease|
(which numify to -1, 0, +1)
That way, reading the S29 text makes more sense.
This is, I believe, what Joe was pointing out needed to be fixed.
-- Darren Duncan
ence of mine,
as I prefer standardizing on prefix notation for all routine/operator
calls where possible. Still, I suppose I may not complain too loudly
if the change you suggest was made.
I'd be more interested in hearing what precedents if any exist in
this regard. What do other languages call the same concepts?
-- Darren Duncan
well as an open-ended problem.
A better use of this discussion is perhaps to determine whether any
more basic core features would need updating in order to support a
separate extension module to more easily provide the feature that was
being discussed.
-- Darren Duncan
particularly welcome change.
For one thing, it is now possible to have defined, deterministic
semantics while freeing a compiler to auto-parallelize the list
assignment, as the container assignments themselves are now uncoupled.
-- Darren Duncan
ation of simply rounding to lesser precision, not
necessarily just to integers.
Or maybe your question is more about what method to use by default if users
don't explicitly choose one?
-- Darren Duncan
(3,4,5) for example?
Are you just supporting that with all operators for parsing rule simplicity
as per a macro? I can understand that reasoning, but otherwise ...
I would think it makes sense to restrict the use of the reduction
meta-operator to just work over operators that are at least associative.
-- Darren Duncan
at or manipulates the environment is not an operator.
Most language built-ins would qualify as operators, including all pure
functions and ordinary assignment operators.
Built-ins that would not be operators include: print, curr_time, <$*STDIN> etc.
-- Darren Duncan
ets you do the right thing interface-wise while
remaining secure without contortions.
Everything I just said ignores the fact that you can always additionally
make public accessor methods for private attributes, to control/protect
limited access to them for the general public.
-- Darren Duncan
Perl 5 classes have to deal with this problem all the time as
all attributes and methods are actually public even if undocumented.
2. It would be very easy for anyone to defeat the security that the privacy
is supposed to give, without the class being exposed having any say about it.
-- Darren Duncan
erl 6 would be a one-element array|seq whose element is the
empty array|seq. That is,
[X] ()
equals this:
( () )
Larry et al, on a related note, the list of identity values for reduce in
S03 should be updated to account for this; [X] wasn't on the list last I
looked.
-- Darren Duncan
any
tuple T with a tuple having zero elements is the first tuple T.
Since the normal output of X is 2-dimensional, it stands to reason that
( () )
should be a reasonable identity value for X, I think.
-- Darren Duncan
g of what a
Junction is; but being a corner-case, that's probably acceptable.
I would assume that invoking .perl on a Junction would result in Perl code
consisting of the appropriate any/all/etc expression. -- Darren Duncan
Jon Lang wrote:
Darren Duncan wrote:
Jon Lang wrote:
Larry Wall wrote:
This is basically a non-problem. Junctions have one public method,
.eigenstates, which is vanishingly unlikely to be used by accident by
any mere mortal any time in the next 100 years, give or take a year.
If someone does
that there should be any problem incorporating this option
given the other issues like named invocants or longname parameters; you just
keep those with PARAMS as you did before, putting the lot on the right side of
the <--.
Note that this request is only useful to me if the existing --> means 'of' and
not 'returns'.
Thank you in advance for considering this request.
-- Darren Duncan
Larry Wall wrote:
On Thu, Mar 19, 2009 at 02:18:35PM -0700, Darren Duncan wrote:
Yes, --> is the "of" type, not the "as" type, as S02 I think says.
Good to know.
Second, since the "sub NAME (PARAMS --> RETTYPE) {...}" form looks nice
visually, I would li
Jon Lang wrote:
And AFAIK the token --> is used in exactly one place in perl 6: within
signature syntax, to mark the transition from the parameter signature
to the "return type" signature. As with Darren, I don't see why this
would be a big problem. The biggest stumbling bloc
should certainly look good
as black and white line-art. I know they are more examples, but some things I
saw suggested looked a bit too complicated. On the other hand, arguably the
gimel is too simple. But I'm sure something good can be worked out.
-- Darren Duncan
attaching them. Who
needs 200K individual emails when a 3K email and a link works fine.
Thank you. -- Darren Duncan
gt;>ö<< form looks more like a Hyper Attack Butterfly
> that is about to bite your face off... :)
Please don't. I think the happy version is much better than any angry or
violent version. We want the logo to evoke happiness after all.
-- Darren Duncan
for Perl 5 ... I still have to
port it to Perl 6, unless someone else wants to do that, but I designed it so
that would be easy to do. The port could stand for some additional Perl 6
savvyness too.
-- Darren Duncan
Timothy S. Nelson wrote:
On Sat, 4 Apr 2009, Darren Duncan wrote:
Speaking of libraries, I already implemented a table type ... it's
called Set::Relation/::V2 and its on CPAN right now ... for Perl 5 ...
I still have to port it to Perl 6, unless someone else wants to do
that, but I des
this is why its useful to have a library to wrap the
functionality, as it can remember those details for you. Set::Relation
currently does keys but not column types; Muldis::Rosetta will do both; either
way, those constraints are optional, though highly recommended in practice.
-- Darren Dun
s and the separation of
pure from impure code shows up often.
-- Darren Duncan
==
SQL:
SELECT 1
Muldis D Text:
function func1 (NNInt <--) {
main {
1;
}
}
or:
function func1 (Relation <--) {
main {
Relation:{
er the AST. Over time
I will continue to add more sugar to make the concrete syntax sufficiently terse
and easier to use.
Meanwhile, what you see is how far along that road of adding sugar I got to.
8. Keep in mind that my example code is meant to be a more literal translation
of what the SQL i
procedure proc1 (Relation &$result) {
$result := $dep.foo;
}
... is like this (pseudo?) SQL code:
CREATE PROCEDURE proc1 (result ARRAY INOUT)
BEGIN
SELECT * INTO result FROM foo;
END;
I hope that answers your question.
-- Darren Duncan
l 6 Synopsis 15, and continue from there.
-- Darren Duncan
o and B depends on an
incompatible version of Foo; then both versions of Foo need to work together.
And that's just one reason to have this support. -- Darren Duncan
ld probably make more sense if = was the
equality test operator, so maybe best to avoid ≠ then.
Lots of the other ones I can think of apply to sets, and the ext/Set.pm bundled
with Pugs already documents them quite well.
However, I think some set ops could also be used with hashes. For example, an
alternate way of spelling "exists %foo{$bar}" is "$bar ∈ %foo" or "%foo ∋ $bar".
So, any thoughts?
-- Darren Duncan
ers too. I mean,
what modern system doesn't support "input methods" by default? People in most
parts of the world must be able to write their non-Latin characters efficiently
on Latin keyboards somehow right? So just use the same method to write your
math/etc symbols. I'm doing so right now and its hardly any slower than typing
ASCII characters. (Note, unlike say Chinese where there could be tens or
hundreds of thousands of characters, I would anticipate that a Perl 6 standard
setting that exploits Unicode would only involve a few dozen math/etc symbols,
not too many to deal with I think.)
-- Darren Duncan
likely be used often enough.
-- Darren Duncan
o make =foo ops, not that this still
can't be done another way.
Larry, did you choose = for assignment and == etc for comparison because you
thought that looked prettier, or because that was the C/etc convention that you
decided to copy?
-- Darren Duncan
ws the ≤ when it formats <=.
I thought so, and that's why its good to take advantage of "the real thing" when
we are able to, and take the approximated spellings for what they are,
approximations.
"exists" has already been changed to an adverb on the lvalue, but I
suppose a macro could still be made to work.
Sure.
-- Darren Duncan
maybe an 'even' operator would be
useful too. This said, assuming you're going for 2 versions of everything, one
high and one low precedence, I have no opinion as to whether ^^ goes to 'odd' or
'one', since AFAIK that isn't a standard symbol for the op from math anyway.
-- Darren Duncan
. which returns 1, indicating also that Perl 5 xor doesn't short-circuit.
Regardless of the above, I think Perl 6 should have both operators, testing
exactly 1 or an odd number.
-- Darren Duncan
ample code, but explanation order too.
-- Darren Duncan
file-system operations.
If you go ahead and put stat ops in Str anyway, then you might as well put
things like a delete_from(Hash $arg) method on Object, which is a less
objectionable version of such backwardness.
-- Darren Duncan
Buddha Buck wrote:
On Thu, Jul 9, 2009 at 9:32 PM, Darren Duncan wrote:
Mark J. Reed wrote:
A few months ago (or maybe more) I proposed making pathnames their own
type, distinct from (or perhas a subclass of) strings, but easily
constructed from strings, maybe with an operator. Having those
o, plain "log" should be a dyadic infix or prefix operator where you can use
any base/radix. If you want something to mean "log to the base 10" then it
should be spelled say "log10", not "log". See, "log" is the most generic
version of the name and so it should be the most generic version of the
operator, taking base as an argument. -- Darren Duncan
sn't conflict with other meanings of "relational" that
relational databases deal with.
-- Darren Duncan
treated more like delimiters, then potentially we
could also have \# to escape literal #, same as we have \' or \" etc.
Having # at both ends makes it easier to see at a glance where comments begin
and end, and potentially it makes it easier to make a parser or syntax colorer.
-- Darren Duncan
literal, except for a lack of interpolation abilities, and literal # are
escaped.
That is essentially how I do comments in Muldis D, and it works quite well.
-- Darren Duncan
Darren Duncan wrote:
Personally, I think that comments should have trailing # as well as
leading ones, so they are more like
Jon Lang wrote:
On Mon, Aug 10, 2009 at 3:36 PM, Darren Duncan wrote:
Personally, I think that comments should have trailing # as well as leading
ones, so they are more like strings in that the same character is used to
mark both ends.
You mean like the following?
q[quoted text]
qq
ferences if or insomuch perhaps as a
symbol/identifier is a "Str". Or it could be less like a Str in the whole but
it would at least contain a Str as an attribute.
-- Darren Duncan
whether it was for the 'if' block it was inside or for the set of statements it
immediately precedes within said block.
I think this can be made to work without much fuss, and it will be valuable.
Both for introspection of op-tree as well as the ability to regenerate the
original
that, say, Instant and Duration are disjoint from Num/Rat. When I say
"disjoint", I mean conceptually that "FileName" say has an attribute of type Str
rather than being defined as a subtype of Str. -- Darren Duncan
r example, 'C:\' becomes '/C/'.
Under Mac OS X, all drives, root or otherwise, are accessible under
'/Volumes//...', and Unix in general lets you mount drives anywhere.
I imagine Windows supports more ways of denoting drives than the drive letter,
but either way I don't see a problem here.
-- Darren Duncan
will look at this new S26 more closely soon.
But one thing I'm not sure whether or not it was addressed is regards to whether
free-form documentation is still supported or can be effectively combined with
embedding documentation into the places that it is documenting.
-- Darren Duncan
c.
(If Perl really must have the ability to change the non-virtual "current working
directory", such as because its going to spawn another non-Perl process, then
this should use some separate mechanism to what all of Perl's own IO uses, and
any such change would have no effect on any Perl $*CWD.)
-- Darren Duncan
to
put across here is concepts.
My main point here is that we effectively can have multiple CWD in the same Perl
thread, and it shouldn't be too much trouble to make this work well.
-- Darren Duncan
as appropriate if it implies you can go to a parent of the
"doi" by way of it, but this is a minor quibble and if the feature is called
"bookmark" I won't really object.
-- Darren Duncan
Timothy S. Nelson wrote:
On Wed, 19 Aug 2009, Darren Duncan wrote:
My proposal is to have
make clear that my proposal is *not* about abstracting away all
kinds of IO into a single uri scheme, but only abstracting the file system. Not
that it can't be further extended in appropriate ways.
-- Darren Duncan
Mark J. Reed wrote:
On Wed, Aug 19, 2009 at 2:35 AM, Darren Duncan wrote:
(If Perl really must have the ability to change the non-virtual "current
working directory", such as because its going to spawn another non-Perl
process, then this should use some separate mechanism to what all
301 - 400 of 632 matches
Mail list logo