Jonathan Scott Duff wrote:
What does p6l think? (What does @Larry think?)
I favor #3 as syntax error.
But note $TSa == all( none(@Larry), one($p6l) ) or so :)
--
TSa (Thomas Sandlaß)
7;!a && !b && !c' which DeMorgan tells us is 'a \\ b \\ c' with
'\\' beeing the high precedence version of 'nor'. So we end up
having a third orish operator:
if $a && $b { ... } # and
if $a || $b { ... } # or
if $a ^^ $b { ... } # xor
if $a // $b { ... } # err
if $a \\ $b { ... } # nor
Well?
--
TSa (Thomas Sandlaß)
true --- like '||' and '//'. At least this is what the logic table
tells me:
a b a nor b == !a and !b
0 0 1
0 1 0
1 0 0
1 1 0
Regards,
P.S.: I've no clue what I meant with delimeter! Should be delimiter :)
--
TSa (Thomas Sandlaß)
ppropriate .serialize() method:
class YAML is Language {
method serialize($data) {
...
}
}
Again, the return type of &YAML::serialize<$> is taken from the
lexical ::?CLASS which is of course YAML?
Regards,
--
TSa (Thomas Sandlaß)
7] enum DayOfWeek ;
my DayOfWeek $day = Fri;
say "Fri = {$day}, Sat = {$day + 1}, Sun = {$day + 2}, Mon = {$day + 3}";
Does that say "Fri = Fri, Sat = Sat, Sun = Sun, Mon = Mon"?
Regards,
--
TSa (Thomas Sandlaß)
| Pair(KeyExtractor, Comparator)
;
used in the sort ruling still current? There the RHS looks more like
a grammar rule alternation which is checked in turn than a real any()
junction.
Regards,
--
TSa (Thomas Sandlaß)
gards,
--
TSa (Thomas Sandlaß)
multi method infix:«>» ( T $x, T $y ) returns bool
{
return not $x <= $y
}
}
Moreover, Num can have subtypes, such as Int or Float, which can be
compared with each other, but not with Str or its subtypes:
class Int is Num {...}
class Float is Num {...}
3 != 3.14 # legal
Sorry if this is too brain-dead!
--
TSa (Thomas Sandlaß)
y
determinable match anyway.
Maybe that's not helpful, but I did warn that I didn't understand the
question!
I'm struggling, too.
--
TSa (Thomas Sandlaß)
n
is vertical with more general towards the top. I'm a bit unsure
what the one-junction A^B really means but the classes that do
it are located in area 1+2 ;)
I hope that helps.
--
TSa (Thomas Sandlaß)
minator.
A longer signature would be aligned after the opening paren---and along
the zone markers.
Regards,
--
TSa (Thomas Sandlaß)
Modula?
Or does that work more like Cecil signature declarations which can be
spread out as needed and actually express a callers expectations which
can be matched with the implementation side?
MfG
--
TSa (Thomas Sandlaß)
only uses e.g. the unrelated types
A, B and C then Any is A|B|C. Likewise for programs
that implicitly handle strings and do numerics one
gets Any = Str|Num.
BTW, are Num and Int distinct or is there a
relation: Int is/does Num?
Regards,
--
TSa (Thomas Sandlaß)
#! /usr/bin/perl
$s = @ARGV[0];
if ($
here's a trait_auxiliary:shall
mentioned in A12 which I've not seen in action somewhere. This could
be the second meaning and roles in signatures describe what is *done*
to the arguments not what they shall be able to do.
I still wonder how the type system really works...
--
TSa (Thomas Sandlaß)
polymorphism should be accompanied by a
constraints system to get CBP (Constraint-Bounded Polymorphism) which
is a superset of F-Bounded Polymorphism. This proposal is polymorphic
as well: some consider it Hell others Heaven---with roles flipped when
it comes to excessive use of (implicit) Any ;)
MfG
--
TSa (Thomas Sandlaß)
myself that this is the Right Thing, but I thought I'd throw
the idea out there to what others thought of it.
I see some convergence and choices where that is not the case.
MfG
--
TSa (Thomas Sandlaß)
d skipping whitespace.
Just an idea...
--
TSa (Thomas Sandlaß)
structured values.
To me handling XML data is an area where Perl 6 could|should|will excel!
I think Perl 5 already does.
MfG
--
TSa (Thomas Sandlaß)
r algebra.
Mine is from type theory.
Einstein's presentation is a whole lot easier to understand than the one above.
Sorry, I make a second attempt in another reply.
--
TSa (Thomas Sandlaß)
<: is the subtype relation operator. Saying Int <: Num
means Int is a subtype of Num. With generic types like the
Array of ... the question is how this relation shall carry
over to the Array type instances.
Int @i;
Num @n = @i; # type error?
Regards,
--
TSa (Thomas Sandlaß)
le *ignoring* the predicate.
Regards,
--
TSa (Thomas Sandlaß)
cos is used for
cases like:
Degrees $angle = 30.0;
if cos $angle > 2.0 { print "HaloO typechecker!" }
And I still wonder if the ones without '°' on their keyboard could
directly call 'cos $angle'.
Regards,
--
TSa (Thomas Sandlaß)
Juerd wrote:
Larry Wall skribis 2005-03-11 8:45 (-0800):
On Fri, Mar 11, 2005 at 03:58:13PM +0100, Thomas Sandlaß wrote:
: Int @i;
: Num @n = @i; # type error?
I think the naive user is going to expect that to work, and I also
suspect the naive user is right to expect it, because it makes sense
lue or complain about not beeing able to due so.
Regards,
--
TSa (Thomas Sandlaß)
ahh
Or are these two are now strictly methods without functional forms?
Sorry I don't know what you are asking for. What is then a method with
functional form? Do you mean that the entries in an array are off-limits
to the outside and can be accessed only by the subscripting methods?
Regards,
--
TSa (Thomas Sandlaß)
[Str]]
^ Pos[Str] where { 0 <= $_ < $searched.elems }
{
...
}
In perl5 that returns 5, but IMHO -1 would be right result.
This is because of the usage of "". Otherwise it's -1.
Regards,
--
TSa (Thomas Sandlaß)
then actually become a call of 'as bool'.
Regards,
--
TSa (Thomas Sandlaß)
rglist and MMD is compiled. Right?
A very nice feature of the compiler here were to perform implementation
side checks when the complete program is loaded? This involves potential
ambiguity and absence failures.
BTW, how far down to pure byte code can Perl6 packages be compiled?
Too much off the mark?
--
TSa (Thomas Sandlaß)
and Str[bin] that can be build from Num
and Int by means of 'as Str[::base]' where ::base chooses the correspondig
pattern to constrain incoming strings and the format for numbers. Or these
are subclasses of Str.
An example:
my Str[hex] $hex = "abc";
say $hex as Int; # prints 27
ngs on copies?)
1 and 2 are backed by the runtime dispatch and type check system.
Depending on compiler switches they also constitute the compile
time type checking.
Regards,
--
TSa (Thomas Sandlaß)
te or whatever it is performed? Or does
the implementor of the class have to revert to blessing in
the constructor? Wouldn't this prevent static type checking
unless the compiler would call the constructor in some
hypotheticality mode to produce type information.
Regards,
--
TSa (Thomas Sandlaß)
ot; as Str[Roman] as Int; # prints 7
Of course then we need
class Str[ uint $radix where { $radix > 1 } ]
{...}
class Str[ ::T does StringNumification ]
{...}
But for literals and input values with a fixed radix, I kinda like
the : notation.
Yes, it's cool and very general!
--
TSa (Thomas Sandlaß)
ng roles is not
much harder than explaining tied variables.
Regards,
--
TSa (Thomas Sandlaß)
s a feature somewhere
to have more than one slurpy array or hash with different
types.
Regards,
--
TSa (Thomas Sandlaß)
(Thomas Sandlaß)
Luke Palmer wrote:
So if you want things modified, you'd have to pass in a reference.
Arrays and hashes would not generally have this restriction, since we
pass references of those guys anyway.
But I would really like to see a declaration of any possible modification
in the interface of a sub. Othe
scope or not. OTOH, copy and paste of lines might change meaning
without the compiler having a chance to detect it!
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
Unless the caller can't see the signature, as is the case with methods.
[..]
Again, this can't be done unless you know the signature. And in fact,
we can't do type inference on methods unless we do type inference
everywhere, which we can't do if we want an autoloader.
This sound
HaloO Luke,
you wrote:
No, I think I agree with you here. But what happens if you change
you're second-to-last line to:
my $a = foo();
$a.meth() = 8;
Perl 6 is both a statically typed language and a dynamically typed
language, and the problems that I am addressing are mostly about the
dyna
of them containing Anthrax or not, as long as they bear the
right stamps!
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
class CodeProxy {
has Code $.code is rw;
sub call ($a) {
$.code($a);
}
}
This is valid Perl 6,
Hmm, a sub in a class? I guess that should be a method. OTOH a
class is just a funny module, so might be OK. But that is the
syntax realm.
a
. One should think of a type system like dependency declarations
in a Makefile: you get out what you put in. Too few dependencies might result
in incomplete rebuilds. Complete dependencies might remind you how convoluted
your design is. And make doesn't manage circular dependencies :)
--
TSa (Thomas Sandlaß)
e on the list or a general laxity to not specify a return type of
subs and methods. I consider leaving it to the compiler to infer it bad
style. BTW, what is the default return type? Just Void? Is an explicit
return statement than a compile error?
--
TSa (Thomas Sandlaß)
Thomas Sandlaà wrote:
Int|Str <: Str && Str <: Int|Str && Int|Str <: Int && Int <: Int|Str
holds.
Uhh, I hardly believe that it was me writing that last night!
Int|Str is of course a proper supertype of Int and Str respectively.
So we really have: Str <: Str|Int && Int <: Str|Int, which warps us
o @:pos
}
}
Question:
does the compiler go over this source in multiple passes
such that the declaration of :analyse is known before its
usage in infix:<=>?
--
TSa (Thomas Sandlaß)
...} }" by virtue of
the nada operator---whatever exception it throws and how much it tells
about X::meth().
--
TSa (Thomas Sandlaß)
obviated in Perl6.
--
TSa (Thomas Sandlaß)
HaloO Juerd,
you wrote:
Thomas Sandlaß skribis 2005-04-01 23:37 (+0200):
So you expect $bar to contain value 2 and detach from $foo?
No. But if you said $baz instead of $bar, then yes.
Ohh sorry, I mis-read your mail as talking about chains of
references: $baz to $bar to $foo to 2. The last step
level and accumulating traits while doing
so. Usually you don't even know how many levels of indirection there are.
I generally don't like it when things half-smudge important differences.
Me neither.
--
TSa (Thomas Sandlaß)
invocant, the method
can easily check if it was invoked on the topic with $_ =:= $?SELF
--- "Wait a moment, are you talking about me?".
Regards,
--
TSa (Thomas Sandlaß)
thing for the Parrot folks is the mixed case!
The homogenous cases are up to the languages. But for the mixed case some
meta language level has to define semantics or the languages have to adapt
from the inside out by explicit foreign knowlegde.
Regards,
--
TSa (Thomas Sandlaß)
Larry Wall wrote:
Roles cannot be derived from, so they're always final in that sense.
We should probably consider them closed by default as well, or at least
closed after first use. If a role specifies implementation, it's always
default implementation, so overriding implementation always occurs
HaloO Larry,
you wrote:
On Thu, Mar 31, 2005 at 06:35:06PM +0200, Thomas Sandlaß wrote:
: Is typing optional in the sense that it is no syntax error but
: otherwise ignored? To me this is pain but no gain :(
Well, you guys keep ignoring the answer. Let me put it a bit more
mathematically. The
Juerd wrote:
Thomas Sandlaß skribis 2005-04-04 18:50 (+0200):
In particular what does &infix<=> do?
Depends. What does it mean? :)
Specifically, what is &infix, what is <=>?
Ups, a missing : warps this to a completly different meaning!
Comparing a coderef &infix with
wed, or is it?
&infix : . .
The dot forms would allow alignment when dumping a complete multi
with every sig on a seperate line. Or for all infix operators, etc.
Is &foo<$bar> a symbolic access or a syntax error? How about
&foo<$bar> = sub ... # ... here means appropriate def
siglet syntax, too?
sub foo :(Str,Int) of :(Any) {...}
Will there be an announcement if this syntax becomes official?
BTW, would it be a good idea that you make such decisions known on p6a?
--
TSa (Thomas Sandlaß)
y if the creation of new values and eventual GC of orphaned ones
is really too expensive you need to add methods that handle in-place
modification, or actually hand it down to COW/GC of more lightweight
elements of your Sumo object :)
--
TSa (Thomas Sandlaß)
x : Int;
But how is the return type of the return type of foo specified?
Is that &:(Any returns Int) and &:(Any of Int)?
Or &:(Any):(Int)?
Or inside &:( Any of &:(Int) )?
We are making progress, but not there yet, I think.
--
TSa (Thomas Sandlaß)
the
all() junction.
Regards,
--
TSa (Thomas Sandlaß)
amp;) case. BTW, I know that
&infix_prefix_meta_operator:{'»'} isn't mentioned in A12.
I could be wrong, though; I can't find any support for it in the design docs.
Indeed, "upgrade" is a bit fuzzy ;)
--
TSa (Thomas Sandlaß)
Rod Adams wrote:
Thomas Sandlaß wrote:
I'm not the junction expert, but it's said that they wrap around
indexing/slicing! So the @array[!-2] would just read @array[none(-2)]?
But how does none() get the base set where the second to last is excluded
from?
It does no such thing. It cre
valuation in the functional
paradigma or code morphing 'x() * y()' to '(($t = x()) != 0) ?? $t * y() :: 0'
or some such. On assembler level this morphing reduces to an additional
check of a register for zero. But I'm not sure if the type system and the
optimizer will be *that* strong in the near future ;)
Regards
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
Okay, now we're starting to talk past each other. I /think/ Thomas
orignially suggested that we use type inference to determine whether to
lvalue cast an argument or not, which is what I got all worked up about.
Actually I was returning to the subject of co- or contravariance of
Thomas Sandlaà wrote:
Any might just be a glb (greatest upper bound) of Int and Str, written
Sorry that should read lub (least upper bound). Glb means greatest lower
bound and is spelled Int&Str or all(Int,Str) in Perl6.
--
TSa (Thomas SandlaÃ)
falls were identified when they are combined.
--
TSa (Thomas Sandlaß)
quot;blubb" has got a method .method that takes a Num as param ;)
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
My brother asked me to take out the trash. I asked him to do it.
I believe that the subject there is "my brother" in the first sentence
and "I" in the second. The topic is either "to take out the trash" or
just "the trash" throughout (English speakers wouldn't have any trou
our.
my Test $test .= new;
my $ret = $test.foo; # unthrown-exception undef|42?
No, $ret == 42 unless Test::foo() is implemented and returns
something else.
Regards,
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
S12 says:
subtype Str_not2b of Str where /^[isnt|arent|amnot|aint]$/;
My brain parses this as:
subtype Str_not2b[Str where /.../];
Or:
subtype Str_not2b[Str] where /.../;
I guess my mental parsing problems stem from the fact
that it was you who told me about the equiv
Luke Palmer wrote:
Ahh, you came in too late. I don't remember who coined it, but @Larry
is the array of Larrys, that is, the design team.
Aha. What does [EMAIL PROTECTED] evaluate to? How do the elements of
@Larry communicate?
I agree with you there. $Larry has said that he wants `when` to work
HaloO,
On Monday, 16. June 2008 10:11:49 Ovid wrote:
> For example, should the pre/postfix '++' be
> listed as having a side-effect?
I think so. But the scope where these side-effects take
place is important as well. In your second example below
the side-effect is restrained to the subs scope. Th
Autrijus Tang wrote:
pugs> split /(..)*/, 1234567890
('', '12', '34', '56', '78', '90')
Is this sane?
Why the empty string match at the start?
--
$TSa == all( none( @Larry ), one( @p6l ))
Larry Wall wrote:
Speaking of which, it seems to me that :p and :c should allow an
argument that says where to start relative to the current position.
In other words, :p means :p(0) and :c means :c(0). I could also see
uses for :p(-1) and :p(+1).
Isn't that slightly inconsistent with :p meaning :p
Benjamin Smith wrote:
sub foo { my $x; BEGIN { $x = 3 }; say $x }
foo; foo; foo;
Currently in perl5 and pugs this prints "3\n\n\n".
Which to me looks like a mix of runtime and compile time.
Actually Dave Mitchell confirmed that this is the case in
Perl 5. I have difficulty to regard this as a f
Larry Wall wrote:
: Void context still exists and is not a form of singular or plural
: context. Perhaps this should be called nullar context, although void
: context works equally well for me and is not confusing because we have
: no Void type.
Nice, without Void we don't need the double headed
ps
Autrijus Tang wrote:
Imagine:
pugs> '1.28' * '2.56'
3.2768
What is (or should be) going on here here?
My personal favorite is
[5] none of the above -- that should be a type error. ;)
But only if MMD doesn't find a unique handler. That is I would
favor 'type error' =:= 'no handler || ambiguo
Autrijus Tang wrote:
So does it mean that a "3-story" multisub with two colons will
always win against one with one colon?
multi sub foo (Any $x: Str $y: Str $z, Str $w) { 1 }
multi sub foo (Str $x, Str $y: Str $z, Str $w) { 2 }
say foo("x", "y", "z", "w"); # 1
Is the final level ($z an
Michele Dondi wrote:
On Wed, 18 May 2005, Rob Kinyon wrote:
1) undef (which may or may not contain an exception), or
2) some unit/identity value that is a trait of the operator,
I think that the unit/identity/neutral value is a trait of the
operator *and* the type of the values which are expected f
HaloO Ingo,
you wrote:
I wondered if it would be useful/good/nice if the syntax for
specifying role parameters would be the same as the standard
subroutine signature syntax (minus the colon, which
separates the parameters which do account to the long name
of the role from the ones which don't).
Ingo Blechschmidt wrote:
I meant: The colon should still act as the delimiter between the params
which account to the long name of the role and those which don't, but
otherwise the syntax should be the same as the standard subroutine
signature syntax, allowing optional params, etc.
I don't think th
Miroslav Silovic wrote:
Uhm, but C++ templates are subject to (compile-time) MMD, once you
specialise them. In other words,
role Something[Int $num] {...}
role Something[String $num] {...}
Hmm, C++ has no free floating templates. They always template a
class/struct or a function. The Perl6 equiva
ply forget the braces around 42? :)
No, it was intented for seeing what the reactions will be :)
Just using &foo as unsigiled variable. This might need
my &foo is rw;
But then I presume you could say:
foo = 17;
if foo < 8
{
@a[foo] = 8;
}
We could call that a codeless lvalue sub ;)
--
TSa (Thomas Sandlaß)
ns [<] and [<=] naturally come out as min
and strict min respectively.
Is it correct that [min] won't parse unless min is declared
as an infix op, which looks a bit strange?
if 3 min 4 { ... }
--
TSa (Thomas Sandlaß)
there a syntax to invoke the
target selection from a multi? E.g. &op.select($value,$value) here?
Or is it &op:($value,$value)?
--
TSa (Thomas Sandlaß)
template ( FooClass ::foo :)
{
my foo $f;
... # use $f
}
--
TSa (Thomas Sandlaß)
bj;
my T $y = $x;
With my proposal from above the short form could be
:[T] $x := $obj;
my T $y = $x;
or the current form with :()
:(T) $x := $obj;
my T $y = $x;
Regards,
--
TSa (Thomas Sandlaß)
Larry Wall wrote:
On Wed, Jun 08, 2005 at 12:37:22PM +0200, "TSa (Thomas Sandlaß)" wrote:
: BTW, is -> on the 'symbolic unary' precedence level
: as its read-only companion \ ?.
No, -> introduces a term that happens to consist of a formal signature
and a blo
ctical distinction possible because of:
my $object = new Foo;
my $meta = $object.meta;
$meta.bar() # calls submethod but looks like method call
I guess the type of $meta is Ref of Class or somesuch.
Regards,
--
TSa (Thomas Sandlaß)
e(Int, 17);
my @a = make(Array, [1,2,3]); # single element array?
# or three element array?
my $e = make(Int 'string'); # type error in &make?
With the automatic binding of a ::Type variable to the type
of it's argument the definition of &make could be shortend to
sub make ( ::Type $value ) returns Type
{ ... }
and called like this
my $i = make(17);
which at least prevents type errors ;)
Regards,
--
TSa (Thomas Sandlaß)
Stevan Little wrote:
You seem to indicate that submethods are not to be used on instances,
and instead to be used on the underlying metaclass. I did not see
anything of the sort in (Syn|Apoc)12 or in my (limited) search of the
mailing list. Can you point me to that information?
S12 says in th
. chars in strings depending on the
Unicode level and index arithmetic of arrays. Some unification of the
underlying math would be nice, indeed. And that typically involves
starting from 0 and the positive remainder pointing into the day.
Regards,
--
TSa (Thomas Sandlaß)
be instanciable? I guess the explicit forms are:
FooStuff[Int]::foo(1,2);
&strfoo ::= (FooStuff[Str].new)::new; # from Autrijus Hackathon notes
Will re-instanciation be prevented when the latter is spelled
&strfoo := (FooStuff[Str].new)::foo; # or with =
Actually this syntax might be wrong usage of ::.
But do I get you right that the lazy forms are
does FooStuff; # lazy role instanciation into current scope
foo(1,2); # &FooStuff[Int]::foo:(Int,Int)
foo(1,'blahh'); # type error?
Regards,
--
TSa (Thomas Sandlaß)
stant
I assumed lvalue subs would implicitly return void and an
assignment goes to the function slot of the args used in the assignment
and subsequent calls with these args return exactly this value.
In that respect arrays and hashes are the prime examples of lvalue
subs. Other uses are interpolated data, Delauny Triangulation etc.
Regards,
--
TSa (Thomas Sandlaß)
n-invocant params, in assignments etc.
For research on the topic see e.g.
http://www.cs.washington.edu/research/projects/cecil/www/Papers/predicate-classes.html
--
TSa (Thomas Sandlaß)
compensated by a good match.
--
TSa (Thomas Sandlaß)
does(Num) }) {...}
beeing the same as
multi sub foo (Num $x) {...}
--
TSa (Thomas Sandlaß)
lways coming in out of band? So .bar is always
invoked on the invocant of &foo if we think that there is an implicit
$_ := $?SELF before the call to &baz in &foo. And I hope the binding
of $_ to $?SELF is a read-only binding!
--
TSa (Thomas Sandlaß)
Mark Reed wrote:
On 2005-07-12 12:22, "TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]>
wrote:
I am also interested in the rationale behind the approach to manage MMD
my means of a metric instead of a partial order on the types.
Metric is a geometric concept which in my eyes doesn
HaloO Larry,
you wrote:
On Tue, Jul 12, 2005 at 08:13:22PM +0200, "TSa (Thomas Sandlaß)" wrote:
: Actually it's a pitty, that the multi method call syntax isn't as
: rich as the single method call syntax where we have .?method, .+method
: and .*method. Something like (S
p;l=50&co1=AND&d=ptxt&s1=ferragina.INZZ.&OS=IN/ferragina&RS=IN/ferragina
I haven't check the relevance to Perl6 yet.
Has someone access to the STOC'99 paper?
--
TSa (Thomas Sandlaß)
1 - 100 of 184 matches
Mail list logo