int but I would
opt for ([3]). In general the builtin operators should be grouped into
roles which are in turn composed into classes like Num which implement
them.
--
TSa (Thomas Sandlaß)
ent! Or am I missing
something? I mean are all topicalizers properly temping $_?
How is that enforced in non-standard code?
BTW, is $_ more a global variable with lexical overriding or an
always passed implicit argument to blocks? E.g. all methods get
an implicit *%_ or was that for submethods on
Same reasoning applies for [*] gives 1 and for [~] you get ''
when ~Any =:= Str. All that is more or less my way to repeat what others
have said in this thread.
--
$TSa =:= all( none( @Larry ), one( @p6l ))
ith implementing
class Scalar does Ordered[Num|Str] {...}
Actually the class might be needed only as namespace containing
the implementation of &infix:{'<='}:(Num|Str,Num|Str: --> bit).
OTOH it could implement caching of conversion results or some such.
--
$TSa =:= all( none( @Larry ), one( @p6l ))
s, or the other way round. Should be consistent.
--
TSa (Thomas SandlaÃ)
expressiveness?
--
TSa (Thomas SandlaÃ)
rl5 to Perl6, including
referential semantics. Until now you haven't convinced me of
the advantages of the old-style Perl5 references. What do they buy us?
--
TSa (Thomas Sandlaß)
al reasons more inclined to think
about this language feature more in terms of combinations of
eval, join and split. E.g. could the macro assistence for »« and []
be restricted to parse their inside as an operator name so that
the programmer doesn't have to use their long name? Or is something
more complicated needed? And if yes, then why?
Regards,
--
TSa (Thomas Sandlaß)
Monoid[Str,~,''] {...}
class Complex does Field[Array[2] of Num,+,[0,0],*,[1,0]] {...}
class 3DVector does VectorSpace[Array[3] of Num,+,[0,0,0]] {...}
And it provides valuable information to the optimizer.
--
TSa (Thomas Sandlaß)
rry, is it the case that $x = $y < $z might put something else
but 0 or 1 into $x depending on the order relation between $y and $z?
--
TSa (Thomas Sandlaß)
ar(Any:) { 42 }
method baz() { &bar }
}
But I think it's better to make &bar a sub.
--
TSa (Thomas Sandlaß)
isn't. It's a type.
BTW, is % defined as truncation in Perl6?
That would be a bit unfortunate. Simple but not well thought out.
--
TSa (Thomas Sandlaß)
es of Code? E.g. &infix:{'='}:(Array:Eager --> Eager) would
not flatten but store the incoming value and return it for chaining
assignment.
--
TSa (Thomas Sandlaß)
, the variable name is not known until runtime, so I
think this should be forbidden. Correct?
Well, &my has got a runtime counterpart which creates a fresh
set of local variables everytime the code object is invoked.
--
TSa (Thomas Sandlaß)
0.5 )
trunc $x == $x < 0 ?? ceil $x :: floor $x
To @Larry: how are mod and div defined in Perl6?
--
TSa (Thomas Sandlaß)
be 4 not bit::true, right? Even ~+?*+?$a is
as far as the value is concerned a no-op? Thus to really flatten away the
value one needs to use ?^ which has bit as the alpha pendant?
If my above assumptions are correct I would like to get bool as the
alpha pendant to ? like not for !. BTW are num and str the equivalents
of + and ~ respectively? And - has no corresponding neg or so? The strings
'true' and 'false' should really be kept as enums of the bit type.
Thanks for your patience with me.
--
TSa (Thomas Sandlaß)
and @a[0] == 1, but @b[0][0] == 1
What would actually be the equivalent syntax to @b?
Is it %b<> or %%b or even (*%b)?
It will hardly be %b{undef}, though.
--
TSa (Thomas Sandlaß)
x:<,>:(:*Num --> Eager of Num)?
BTW, another mystery to me is which operators are pure code types,
which ones are macro assisted---and to what extent---and which are
pure macros aka syntactic sugar/necessity without a specific
implementation backend.
So, to summarize we could interpret our points of view as
"syntax-down" and "type-up" if the upward direction is from
implementation to type to syntax.
--
TSa (Thomas Sandlaß)
infix:<,> ( ... ) is assoc(list). Could/should the same be done
as chainfix, leftfix and rightfix? Or asterfix, idfix, truebafix, ... :))
This last joke might work for Germans only.
--
TSa (Thomas Sandlaß)
My line of thought might actually be easier to understand if
you treat = as a normally dispatched infix operator without any
special significance. The two operators ::= and := are *not*
dispatched. They are macros or a direct part of the grammar.
::= is mostly syntactic sugar for a BEGIN block and := is basically
compiled to the engine level destructive assignment operation.
But this view might also be completely wrong.
Regards,
--
TSa (Thomas Sandlaß)
e. It's much easier to just compile to MMD code and leave
the rest to the runtime dispatch. But this requires a self-contained
definition of the meaning of @a and [] as described by Rod.
--
TSa (Thomas Sandlaß)
ree? On the Perl6 language level references
are a means to share values. Don't mix that with the implementation
level references---which should be called pointers---that allow an
efficient implementation of handling heavyweight data.
--
TSa (Thomas Sandlaß)
Ingo Blechschmidt wrote:
# Please add more ways :)
enum ;
my &MEANING_OF_LIVE = 42; # But might be considered evil sigilless mode
--
TSa (Thomas Sandlaß)
y @data is DatabaseTable;
my %tree is StructuredDocument;
--
TSa (Thomas Sandlaß)
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ß)
x27;=='} ] {...}
class Str does Identity[ &infix:{'eq'} ] {...}
To what exteent in canbe auto-generated with dispatching to
the respective methods of all elements defined into the class'
value environment, I can't say.
--
TSa (Thomas Sandlaß)
the pair \ and =.
I admit that :\ is not a real beauty but it's seldomly used anyway.
The only question that remains is how then to single step down
the link chain if that isn't contradicting the link concept in
the first place. But I think it doesn't need an operator.
A method might suffice:
:\$link.follow.follow # two steps down
--
TSa (Thomas Sandlaß)
combinations of signs which must be considered when
calculating $q and $r such that $x == $q * $y + $r holds.
Avoids lots of special case code across 0 boundaries.
If there is a definition that needs no special casing
then it is the euclidean definition that 0 <= $r < abs $y.
--
TSa (
#x27;Lazy of Int'. In a signature you use the
slurpiness indicator * which I presume is available in :() as well.
So a list of Int might be :(*Int) and a recurring tuple type might
be :(*(Int,Str)).
--
TSa (Thomas Sandlaß)
rom -12.0 to +11.9... that is +12 is the -12
of the next day. And 0.0 is noon. And of course the clock is rotating in
mathematically negative direction :)
I just see arithmetic regularity.
--
TSa (Thomas Sandlaß)
there should
be some common base type that can handle cross-calender arithmetic
but as long as one stays in a homogenous subtype like Gregorian
in a particular time zone no generalization code should fire up.
--
TSa (Thomas Sandlaß)
rom all this is that the notion of context is Perl's
version of static typing ala C++ and Java.
Sorry if this wasn't what you wanted to hear.
--
TSa (Thomas Sandlaß)
ist is
a subtype of Code. Like the talking frog that the geek takes
as it is instead of flattening it into a princess :)
The princess here beeing the list of everything the frog had
to say before his disappearance. Hmm, and ** beeing the kissing
operation ;)
--
TSa (Thomas Sandlaß)
by means of adverbial modifiers.
Well or that a rw role can be composed into a reference to
force binding behaviour. BTW, but is lower in precedence than \,
isn't it?
--
TSa (Thomas Sandlaß)
nt match object/state
as invocant? I would assume that everything else can be found
through it? Actually the mnemonics that $/ is the match and
methods on $?SELF are called with ./method fits. The only
remaining thing is to define the method set of the Match class.
--
TSa (Thomas Sandlaß)
t returns %hash?
Sorry, I don't understand this question. Do you want 'shallow copy'
to mean 'take a ref'? Or Parrot/Pugs level COW?
Are you alluding to the referential semantics discussion?
--
TSa (Thomas Sandlaß)
ll have a proxy
anyway to handle assignment.
Another general thing is of course that explicitly constant Refs
shall not be applicable as a lhs of assignment. This applies to
chains of prefixed $ as well.
--
TSa (Thomas Sandlaß)
you know better than I.
I'll be appreciative of any illumination that others can provide
to the above, especially from @Larry.
Sorry, I'm neither one(@Larry) nor a good Illuminati ;)
--
TSa (Thomas Sandlaß)
tfix:<()>
And it nicely lines up with $y[], $y{}, @a[], %h{} etc. as
dereferential expressions.
--
TSa (Thomas Sandlaß)
rator name---like a sigil---or purely syntactical. A method is e.g.
also not defined with the dot:
class Blahh
{
method .example ( $non_invocant ) {...}
}
--
TSa (Thomas Sandlaß)
ension of the above is that the type system might be able
to dynamically instanciate parametric types to fill 'gaps' dynamically.
Something like 'compilation on demand' if that is the only way to actually
instanciate a template---but I'm not sure if Perl6's parametric types are
actually called templates.
I hope that helps.
--
TSa (Thomas Sandlaß)
+1/3, 0+2/3 [;] -1+0/3, -1+1/3, -1+2/3 )
@a.[ 0..2 [;] -3..-1].reverse
== @a.reverse.[-1..-3 [;] 0.. 2]
== @a.[ 0, 1, 2 [;] -3, -2, -1 ].reverse
== @a.reverse.[ -3, -2, -1 [;] 0, 1, 2 ]
== ( -1+2/3, -1+1/3, -1+0/3, 0+2/3, 0+1/3, 0+0/3 )
Call that the DeMorgan o
postfix -> is now spelled ()
isn't it?
--
TSa (Thomas Sandlaß)
Piers Cawley wrote:
"TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]> writes:
Piers Cawley wrote:
My preference is for:
Boo
Boo
Can't dereferene literal numeric literal 42 as a coderef.
How do you reach the second 'Boo'? Iff -> does not create a Sub
but
an undef
or some such.
$code($cc);
}
Which I personally think is rather cute.
Me too!
Even if I can't quite bring myself to
believe it's that simple...
I have convinced myself.
How can I be of assistance on your side?
--
TSa (Thomas Sandlaß)
reator!
And I hope Juerd likes it. After all it looks *pointy* :)
PS: A chain of refs can thus be reduced to the leaf lvalue with
([()] $rr) = 23; which stores a new value in $x. This might even
warrant the special case of ([] $rr) = 23;
--
TSa (Thomas Sandlaß)
, $value ) looks even better. This
folds the identity value selection problem back into type-space
and it's runtime agent MMD.
--
TSa (Thomas Sandlaß)
Well,
does using -> as blockref creator also give anonymous scalars?
$y = -> $x { $x = 3; $x }; # $y:(Ref of Block of Int)
BTW, is -> on the 'symbolic unary' precedence level
as its read-only companion \ ?. Are they pure macros?
--
TSa (Thomas Sandlaß)
ue that &prefix:{'->'} returns
while in the snippet above it is explicitly coded.
Or do I completely misunderstand the distinction between
blocks and closures?
--
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ß)
contains some targets with and some
without an identval?
Finally I don't understand how the knowledge about a pending assignment
eases the choice problem for the multi. Note that the choice of
assignment operator depends on the return value of the operator and
the type of which the lhs is undef.
Regards,
--
TSa (Thomas Sandlaß)
a more
declarative style of predicate specification would be
helpfull.
PS: Of course this example also implies that each parameter's
declaration introduces a new lexical scope to its right.
Well the colloquial spec of your function is just 'it takes
two equal integers'.
xpected
price to pay for predicate dispatch. And the target selector living inside
the MMD object might actually be 'recompiled' during runtime when new
instances are added. That is similar to the automata behind regular
expressions.
Regards,
--
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ß)
ere seems to be
some overlap in particular in the construction process which is
characterized as involving an unitialized object. So in that case
some macro magic might make the instance available to the submethod.
But this will be a non-invocant parameter.
But mind the sig!
--
$TSa =:= all( none( @Larry ), one( @p6l ))
. 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ß)
allow a compile time detection. Note that the
ambiguity doesn't go away with a metric approach because there are no
other parameters that could compensate.
Regards,
--
TSa (Thomas Sandlaß)
the type system.
If Perl6 wants to live up to the claim of (optional) strong typing
then the dispatch must be first on the type lattice and then on the
class hierarchy. The folks who don't want to adhere to typing might
avoid the type dispatch and appear to the type dispatchers as Anys
or some scoped package or module type.
Regards,
--
TSa (Thomas Sandlaß)
y instanciating the class Foo.
--
TSa (Thomas Sandlaß)
l for Method... hmm have to think about that!
--
TSa (Thomas Sandlaß)
;
my @array = %hash; # should call my own routine
I hope the initialisation in my also calls the overloaded
operator. But why shouldn't it?
--
TSa (Thomas Sandlaß)
d when. I think the compiler has the information about all lexicals
and could put them in the right place in the name space tree *before*
execution. Would that be at CHECK or INIT time?
--
TSa (Thomas Sandlaß)
g that does the
Scalar/Item role! We can consider the sigils as lookup filters.
Regards,
--
TSa (Thomas Sandlaß)
alence of $foo and $::foo as TIMTOWTWI.
I dought that assigning two different meanings just because their
are two syntactical forms is a good idea.
in their behaviour, and I (and other future legions of newbies) would
despair. :)
You consider yourself a 'legion of newbies' ;)
--
TSa (Thomas Sandlaß)
chromatic wrote:
On Tue, 2005-07-19 at 18:47 +0200, "TSa (Thomas Sandlaß)" wrote:
I strongly agree. They should share the same namespace. Since
code objects constitute types they also share this namespace.
This means that any two lines of
class Foo {...}
roleFoo {...}
s
);
for some_values { say }
Hmm, looks somewhat unperlish :))
--
TSa (Thomas Sandlaß)
ny confusion over whether $::foo was your 'closest' $foo variable
or something else.
So to conclude, for reading they amount to the same result but through
different paths. But since the symbolic lookup might result in undef
the behaviour for writing is indeed a Very Different Thing.
@
ch requires a self type of ::FooDefiner
and I think that Int.does(FooDefiner::foo) is false. So an
invocation of &FooDefiner::foocaller would simply produce
a type error or six warnings and no printout if the foo calls
are dispatched over $_, right?
Regards,
--
TSa (Thomas Sandlaß)
SELF that Foo is composed into
obviously is a subtype of Foo. What happens with this hidden payload if
the object changes its type such that it is no Foo anymore? E.g. by
undefining the slot &.Foo::foo?
Regards,
--
TSa (Thomas Sandlaß)
ublicly visible method is called. The private method must be in
scope there. The only requirement on the name is to not leak out into
public namespace.
The problem with
$?SELF.:foo()
is that people see that as a .: operator on the foo method.
Which is a *BIG* problem in an Operator Oriented Language!
--
TSa (Thomas Sandlaß)
forgets about
the Foo role itself.
Ups, I hoped that the type system would find out mismatches of the
objects actual structure and the methods expectations of it. Essentially
rendering the method in question not applicable to the object anymore.
BTW, what is the inverse operation of bless? Expel?
--
TSa (Thomas Sandlaß)
t authority.
But it's not my private opinion anymore ;)
By posting it, it has become part of our @opinions since
this $email does ::Perl6::Language :)
BTW, this also gives us: my @twodim has shape(2);
--
TSa (Thomas Sandlaß)
o verbose. Should be condensed to:
has $.hidden is rw from %private_data;
BTW, I would like to coin the term 'onboard method' for a
code slot of type Method.
# initialized from class
has $.cache is rw from source;
# virtual per instance
has $.value from {...};
}
--
TSa (Thomas Sandlaß)
s that the
current meaning needs parens like ($condition ?? $value :: $other)
for preventing strange tokenization. OTOH would the barebone
structure of Perl6 revolve around ?? :: ::= () ; and namespace lookup.
--
TSa (Thomas Sandlaß)
. allows to define the boolean "type" as
*::false ::= *::bit::0;
*::true ::= *::bit::$_??$_::*false;
or so. And whitespace around ?? and :: doesn't matter!
?? just means skip next lookup if "lookup" fails.
Regards,
--
TSa (Thomas Sandlaß)
d is in that view a *metric* dispatcher
on the middle ::Any between the selector before the dot
and the return type after the arrow.
say bar(@array, "z");# 2 (or 5?)
I opt for 2.
say bar([EMAIL PROTECTED]);# 4
Yep.
--
TSa (Thomas Sandlaß)
ating some code, some revamping or other &DEEP_MAGIC. Hmm, debug
exceptions come to mind...
--
TSa (Thomas Sandlaß)
Luke Palmer wrote:
On 7/26/05, "TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]> wrote:
Piers Cawley wrote:
I would like to be able to iterate over all the
objects in the live set.
My Idea actually is to embedd that into the namespace syntax.
The idea is that of looking up non
HaloO,
Ingo Blechschmidt wrote:
I've probably misunderstood you, but...:
role Complex does Object {...}
Num does Complex;
# That should work and DWYM, right?
My 0.02: Complex should provide e.g. a + that, when
called with two Nums, doesn't bother the return
value to carry on a use
Randal L. Schwartz wrote:
This is similar to the OS-9's "gestalt" tables, which got smarter as
the operating system had more features, but was a consistent way to
ask "do we have a color monitor here?".
Is something like this already planned?
From my bubble in the Perl6 Universe this thing is
HaloO,
Larry Wall wrote:
Yes. The only thing I don't like about it is that any() isn't an Any.
Maybe we should rename Any to Atom. Then maybe swap Item with Atom,
since in colloquial English you can say "that pair of people are
an item."
Since we are in type hierachies these days, here's my
Larry Wall wrote:
On Wed, Jul 27, 2005 at 06:28:22PM +0200, "TSa (Thomas Sandlaß)" wrote:
: Since we are in type hierachies these days, here's my from ::Any
: towards ::All version.
That's pretty, but if you don't move Junction upward, you haven't
really addr
HaloO,
Autrijus Tang wrote:
[..much better explaination of the co/contra prob then mine skipped..]
Hence, my proposal is that Perl 6's generics should infer its variancy,
based on the signature of its methods, and derive subtyping relationships
accordingly.
Yes!! That would be great. But I wou
HaloO Michele,
you wrote:
On Wed, 27 Jul 2005, [ISO-8859-1] TSa wrote:
value to carry on a useless imaginary part. And
Complex should consistently return undef when compared
to other Nums or Complexes. And the Compare role
My 0.02+0.01i: in mathematics it is commonly used to write e.g. z&l
HaloO Autrijus,
you wrote:
D) Make the return type observe both #2 and #3 at compile time,
using type variables:
sub id ( (::T) $x ) returns ::T { return($x) }
And this is a natural extension to guide the inferencer so it won't be
totally giving up on polymorphic functions such a
HaloO Luke,
you wrote:
All in all, generic equality and comparison is something that Perl 5
did really poorly. Some people overloaded eq, some overloaded ==,
some wrote a ->equal method, and there was no way to shift between the
different paradigms smoothly. This is one of the times where we h
501 - 600 of 654 matches
Mail list logo