Em Ter, 2010-04-06 às 22:19 -0700, Damian Conway escreveu:
I kinda hope we can get a bit further away from the machine code
level of reality one of these decades. Perl 6 should not be
optimized for C semantics.
Agreed. But it should at least support those who need to work at
the machine
Larry mused:
Alternatively, maybe there should be some way to express infinite sets.
Not sure I like the idea of an infinite junction, but something resembling:
subset PowersOf2 of Int where any(1,2,4...*)
enum Perms of PowersOf2 Read Write Exec;
say Exec; # 4
Presumably the
Daniel Ruoso pointed out:
Using bitsets in Perl 6 is just as easy as using in Perl 5 -- which
happens to be the same as using in C, but it's not C...
constant PERM_WRITE = 0b0001;
constant PERM_READ = 0b0010;
constant PERM_EXEC = 0b0100;
constant PERM_NAMES = { PERM_WRITE = 'Write',
Damian Conway wrote:
I do like the idea of being able to specify the sequence of values of an
enumeration by using a series of some kind.
And I must say the one that feels most natural is the one that plays on
the equivalence of underlying equivalence of enums and constants, namely:
enum
On Wed, Apr 07, 2010 at 06:33:46AM -0700, Jon Lang wrote:
: That said, don't we already have a means of assigning specific values
: to individual members of an enum? I forget the exact syntax, but I
: believe that it involves an assignment operator within the
: enumeration. Mind you, this is
Jonathan Lang wrote:
Wouldn't that be C = 0...* ?
Indeed. Thanks for the correction.
That said, don't we already have a means of assigning specific values
to individual members of an enum? I forget the exact syntax,
The exact syntax is:
enum Perms [Read = 1, Write = 2, Exec = 4, Fold
We could make enum declarators even more like constant declarators
by using a pseudo assignment. Then we could use = instead of parens:
enum Perms = Read Write Exec Fold Spindle Mutilate Z= 1,2,4...*;
Hmm. That doesn't seem very like constant declarators. In a
constant declarator,
the
Author: lwall
Date: 2010-04-07 20:07:45 +0200 (Wed, 07 Apr 2010)
New Revision: 30332
Modified:
docs/Perl6/Spec/S02-bits.pod
Log:
[S02] some clarifications of the desired semantics of buffers
Modified: docs/Perl6/Spec/S02-bits.pod
Author: lwall
Date: 2010-04-07 20:11:14 +0200 (Wed, 07 Apr 2010)
New Revision: 30333
Modified:
docs/Perl6/Spec/S03-operators.pod
Log:
[S03] remove bogus mentions of Buf8, Buf16, Buf32
Modified: docs/Perl6/Spec/S03-operators.pod
2010/4/6 Larry Wall la...@wall.org:
Set(Read | Write) # bogus, R|W is really 3 sets, R, W, and RW!
Set(Read Write) # okay, can only represent RW
Set(A | B) doesn't seem so bogus to me, if what you want is the power
set- not the original posters intent, but reasonable in other
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Apr 7, 2010, at 00:52 , Larry Wall wrote:
more syntactic and/or semantic sugar. It's just a bit awkward, after
you say:
enum Permissions Read Write Exec;
subset Perms of Set of Permissions;
that the name of the single-member sets are
Aristotle Pagaltzis wrote:
Hi Larry (mostly) et al,
this sounds like something STD could try to steal:
* http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html
Okay, this may be going a bit far, but how else are you going
to fall completely in love with a compiler?
$
On Wed, 7 Apr 2010, yary wrote:
2010/4/6 Larry Wall la...@wall.org:
Set(Read | Write) # bogus, R|W is really 3 sets, R, W, and RW!
Set(Read Write) # okay, can only represent RW
Set(A | B) doesn't seem so bogus to me, if what you want is the power
set
Hmm, surely a power-set
One more idea: could you implement the sort of thing being asked for
by means of a buffer? That is, what's the difference between the
bitset being asked for and a Buf[boolean]? And could those
differences be addressed by composing a Buf[boolean] into a more
appropriate role?
Note also that Perl
14 matches
Mail list logo