Re: Recent news about PGE

2005-11-06 Thread Autrijus Tang
On 11/6/05, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > First, for null input, PGE (and p6rules) will likely parse this > by returning a Match object indicating "false", and attempting > to compile that object will probably return a null subroutine. Yes, that sounds sane. > The other case is

Re: Recent news about PGE

2005-11-06 Thread Autrijus Tang
On 11/4/05, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > As a quick example, one can now use the subrule > to parse a perl 6 rule expression, and the Match object > that is returned contains the parse tree. Other examples > and demonstrations or parsing are in the examples/pge/ > directory. p

Re: Avoid the Yen Sign [Was: Re: new sigil]

2005-10-23 Thread Autrijus Tang
Dan Kogai wrote: > To make the matter worse, there are not just one "yen sign" in Unicode. > Take a look at this. > > ¥ U+00A5 YEN SIGN > ¥ U+FFE5 FULLWIDTH YEN SIGN > > Tough they look and groks the same to human, computers handle them > differently. This happened when Unicode Consortium decided

Re: Accessing parrot functions/PMCs with Pugs

2005-10-22 Thread Autrijus Tang
Christian Renz wrote: > I recently got my feet wet with Pugs. So far, it's been fun > :-). Cool! > However, I couldn't find any information on how to access > functions defined in parrot, or even how to use classes defined as > PMCs in parrot. Is this possible already? If Pugs is linked with Par

Re: new sigil

2005-10-21 Thread Autrijus Tang
Juerd wrote: > I do not see why $ and @ couldn't be both a sigil and an infix > operator, and the same goes for whatever ASCII equivalent ¢ gets. > > ^ and | are available for sigil use. (All the closing brackets are too, > but that would be very confusing because we tend to visually parse those >

Re: Complex types

2005-10-12 Thread Autrijus Tang
Larry Wall wrote: On Thu, Oct 13, 2005 at 09:43:15AM +1300, Sam Vilain wrote: : Hi all, : : Is it intentional that S09 lists unboxed complex types, but equivalent : Boxed types are missing from the "Types" section in S06? Nope. As it's a trivial omission, I went ahead and changed S06.pod (r6

[RELEASE] Pugs 6.2.10 released!

2005-10-09 Thread Autrijus Tang
I am delighted to announce Pugs 6.2.10, released during a slashdotting on geoffb's "Optimizing for Fun" column: http://developers.slashdot.org/article.pl?sid=05/10/09/1831219 The release tarball will be available from CPAN shortly: http://pugscode.org/dist/Perl6-Pugs-6.2.10.tar.gz

Re: A listop, a block and a dot

2005-10-05 Thread Autrijus Tang
Luke Palmer wrote: With parentheses: print((length "foo") < 4) print(3 < 4) So this was quite a disturbing bug. This is now also quite a fixed bug. :-) However: f:{1}.() still parses as (&f(:{1})).() as the "adverbial block" form takes precedence. Is that also wro

Re: FYI: Lambda Calculus on Perl 6

2005-09-04 Thread Autrijus Tang
On Mon, Sep 05, 2005 at 12:35:36PM +0900, Dan Kogai wrote: > And I found that these can be made much, much simpler and more > intuitive with Perl 6, even more so than scheme! > > our $ZERO = sub($f){ sub($x){ $x }}; > our $SUCC = sub($n){ sub($f){ sub($x){ $f.($n.($f)($x)) }}}; > our $ADD

Re: Who is @Larry?

2005-08-25 Thread Autrijus Tang
On Thu, Aug 25, 2005 at 09:25:30PM -0400, Matt Fowles wrote: > I have a simple question. Who comprises @Larry? I am fairly sure > that I know a few people in it, but I am highly doubtful that I know > all of them. dev.perl.org has a "Who's Who" list: http://dev.perl.org/perl6/people.html T

Re: Parrot and Neko

2005-08-19 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 07:37:41PM +0200, Nicolas Cannasse wrote: > I released a few days ago the Neko intermediate language at > http://nekovm.org . In the FAQ I'm comparing Neko to LLVM / C-- and Parrot. > According to a mail sent to me by Leopold Toetsch I got some points wrong > when trying to

Re: P6 Picture Bootstrap

2005-08-19 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 09:45:16AM -0700, Kris Bosland wrote: > Autrijus, I think your pictures look great. Thanks! Want a T-shirt from http://cafepress.com/pugscode/ ? :-) > If it is not too much of a trade secret, I'd like to ask: > > 1. What program(s) did you use to make the pictures?

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 01:36:30AM +0800, Autrijus Tang wrote: > BEGIN { > &foo := a Sub is stub { > ($a) := &?Internals::GETARGS(); > $a = 1 unless exists $a; > # real body begins here > ... > }; > } Er,

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:26:00AM -0700, Larry Wall wrote: > Sure. Though it probably also wants to stay as metadata associated > with the signature, since part of the reason for putting it in > the signature in the first place is so that optimizers can install > constants on the caller end, at l

Re: Serializing code

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 08:22:20PM +0300, Yuval Kogman wrote: > > sub foo { $?DOM.document.write(...) } > > BEGIN { foo() }; # error, there's no $?DOM object > ># at compile-time! > > Unless you're compiling in the browser ;-) Which... is possible, and that's

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Fri, Aug 19, 2005 at 01:15:23AM +0800, Autrijus Tang wrote: > On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote: > > In other words, you could desugar > > > > sub foo ($a = 1) {...} > > > > to > > > > s

Re: my $pi is constant = 3;

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:09:16AM -0700, Larry Wall wrote: > In other words, you could desugar > > sub foo ($a = 1) {...} > > to > > sub foo ($a) { > $a = 1 unless exists $a; > ... > } I like this. Can we go for it, at least for this week? :) Thanks, /Autrijus/ pgpj

Re: Hoping that Params::Validate is not needed in Perl6

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 10:02:23AM -0700, chromatic wrote: > On Wed, 2005-08-17 at 23:43 -0500, Dave Rolsky wrote: > > > But I'd really like to get this stuff done at compile time wherever > > possible. If I write this: > > > >validate( credit_card_number: $number ); BTW, the colon is on t

Re: Implementing perl BEGIN blocks

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 06:00:43PM +0200, Leopold Toetsch wrote: > This shouldn't be a problem (at least when the last few globals from > imcc are gone), i.e. compilation / running code should be fully re-rentrant. Oooh, that will be much better. > BTW can you explain why the above example print

Re: Implementing perl BEGIN blocks

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 04:51:58PM +0200, Leopold Toetsch wrote: > There was some recent discussion [1] [2] on p6l about BEGIN blocks and > constant, which is executed at compile time too. > > Parrot has since quite a time the @IMMEDIATE subroutine pragma, which > causes execution of subs during

Re: Serializing code

2005-08-18 Thread Autrijus Tang
On Thu, Aug 18, 2005 at 12:24:40PM +, Ingo Blechschmidt wrote: > >- closures? > A subclass of Code, e.g. Bare. There is no Bare anymore: Code - Routine - Block Thanks, /Autrijus/ pgplvP6gLhemH.pgp Description: PGP signature

Re: Hoping that Params::Validate is not needed in Perl6

2005-08-17 Thread Autrijus Tang
On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote: > And another question. How will I make Perl6 not do automatic coercion for > me. If I have this sub: > > sub date (Int +$year is required, +$month, +$day) BTW, Pugs supports the ++ syntax, which iirc is said to be back in favour du

Re: Ambiguity of parsing numbers with underscores/methods

2005-08-17 Thread Autrijus Tang
On Wed, Aug 17, 2005 at 11:37:26AM -0700, Larry Wall wrote: > On Tue, Aug 16, 2005 at 05:25:40PM -0400, Roger Hale wrote: > : 1.e5# all of these... > : 1._e5 # > : 1._0e5 # > : 1.e_0_5_# == 1 * 10^5? > > The last three are illegal because underline is allowed

Re: Parrot <-> Java integration

2005-08-17 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 08:07:22PM +0100, Tim Bunce wrote: > Anyone given any thought to Parrot <-> Java integration? I have been looking at IKVM: http://www.ikvm.net/ It's basically a full Java environment but using CLR instead of JVM as the underlying runtime. The JIT conversion from Java

Re: my $pi is constant = 3;

2005-08-17 Thread Autrijus Tang
On Wed, Aug 17, 2005 at 08:47:18AM -0700, Larry Wall wrote: > : >That could be made to work by defining constant to mean you can assign > : >to it if it's undefined. But then it gets a little harder to reason > : >about it if $pi can later become undefined. I suppose we could > : >disallow undefi

Re: Generic classes.

2005-08-16 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 11:07:51AM -0700, Larry Wall wrote: > Sure, except that you're not really inheriting from a role here. > You're really inheriting from an anonymous class of the same name. :-) Hmm, "Anonymous class with the name 'Array of Any'" sounds like an oxymoron. Also consider:

Re: Should this be valid in perl 6?

2005-08-16 Thread Autrijus Tang
On Wed, Aug 17, 2005 at 12:42:31AM +0800, Autrijus Tang wrote: > > class TMP { method tmp { "Hello".say}; }; my TMP $t .= new; > > tmp $t; > > > > So, I wonder, If perl 6 will allow "tmp $t;" > > Hm, I think that's a case of a unimplemen

Re: Should this be valid in perl 6?

2005-08-16 Thread Autrijus Tang
On Tue, Aug 16, 2005 at 03:03:39PM +0800, Yiyi Hu wrote: > $handle.close > close($handle) > close $handle: > close $handle > > >From Synoposis, It's said that the last example( close $handle ) > should be valid. > But in pugs, It isn't. > > class TMP { method tmp { "Hello".say}; }

Re: Time::Local

2005-08-16 Thread Autrijus Tang
On Tue, Aug 16, 2005 at 08:37:24AM -0700, Larry Wall wrote: > : But that's in contrast to your saying that the epoch would be December 31, > : 1999 at 23:59:29.0 UTC. Or did I misread your earlier messages? > > Yes, you misread it. I was angling for 00:00:00.0 UTC. But it scarcely > matters if

Type inferencing for Perl5

2005-08-16 Thread Autrijus Tang
On Tue, Aug 16, 2005 at 02:04:41PM +0100, Nicholas Clark wrote: > On Thu, Aug 11, 2005 at 01:35:14AM +0800, Autrijus Tang wrote: > > On Wed, Aug 10, 2005 at 07:32:01PM +0200, TSa wrote: > > > Counting the sigil quadriga as 4, what is the fifth element? > > & @ $ % ::

Re: Generic classes.

2005-08-15 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 10:43:45AM -0700, Larry Wall wrote: > : So the last line means a role can be used just like a class, and > : _inherit_ its behaviour as well? > : > : role Point { has $.x; has $.y; method move_right { $.x++ } }; > : role MyPoint is Point { > : method move_right

Re: Generic classes.

2005-08-15 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 08:19:38AM -0700, Larry Wall wrote: > I think the distinction is still useful to document that there are > still unbound types. What we need to emphasize is that a role can be > used as a class, at which point any unbound types are bound to Any, > or whatever we're calling

Re: Pugs MetaClass Model Picture

2005-08-15 Thread Autrijus Tang
On Mon, Aug 15, 2005 at 02:03:22PM +0400, Konovalov, Vadim wrote: > > # Pugs - Lambda Camels > > http://pugscode.org/images/lambdacamels.png > > I wonder do greek symbols have any meaning? Yes, "omega" stands for higher-order polymorphism, as in "System F-omega". The reversed "E" is the

Generic classes.

2005-08-14 Thread Autrijus Tang
S06 made many explicit uses of generics as classes, which I find difficult to reconcile with the "only roles takes type parameter" ruling. For example: my Hash of Array of Recipe %book; my Hash[returns=>Array[returns=>Recipe]] %book; And later: class LoudArray is Array { ... } Clea

Re: Pugs MetaClass Model Picture

2005-08-14 Thread Autrijus Tang
On Sat, Aug 13, 2005 at 04:07:28AM +0800, Autrijus Tang wrote: > On Sat, Aug 13, 2005 at 01:08:38AM +0800, Autrijus Tang wrote: > > As promised on #perl6, today I produced a drawing showing how the > > Perl 6 metamodel would work in Pugs. It aims to cover the common > > e

Re: Pugs MetaClass Model Picture

2005-08-12 Thread Autrijus Tang
On Sat, Aug 13, 2005 at 01:08:38AM +0800, Autrijus Tang wrote: > As promised on #perl6, today I produced a drawing showing how the > Perl 6 metamodel would work in Pugs. It aims to cover the common > elements between Perl5, JavaScript and Haskell editions: > > http://pugs

Pugs MetaClass Model Picture

2005-08-12 Thread Autrijus Tang
As promised on #perl6, today I produced a drawing showing how the Perl 6 metamodel would work in Pugs. It aims to cover the common elements between Perl5, JavaScript and Haskell editions: http://pugscode.org/images/metamodel.png I plan to draw another picture showing the time-indexd bootstra

Re: my $pi is constant = 3;

2005-08-11 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 12:41:17PM -0700, Larry Wall wrote: > : If yes, what does it desugar to? > : > : my $pi is constant := 3; > : my $pi is constant ::= 3; > > In this case it desugars to > > my $pi is constant = 3; > > :-) However, I wonder if the intention was to replace the

Re: Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-11 Thread Autrijus Tang
On Thu, Aug 11, 2005 at 09:22:27AM -0700, Larry Wall wrote: > On Thu, Aug 11, 2005 at 10:47:35AM +0800, Autrijus Tang wrote: > : Adding inference ("is typed") to the mix massively sweetens the first > : option, which would be a good thing. > > Only if the programmer ca

Re: Classes as special undefs

2005-08-11 Thread Autrijus Tang
On Thu, Aug 11, 2005 at 04:47:49PM +0200, TSa wrote: > OK, let's play some manual type inferencing ;) Note that $spot here is intended to be dynamic typed, i.e. not subject to inference. :-) > >my $spot = Dog; > > $spot.does(Item of Dog), that means what ever the name Dog represents > was s

Re: Classes as special undefs

2005-08-11 Thread Autrijus Tang
On Thu, Aug 11, 2005 at 08:53:47PM +1000, Stuart Cook wrote: > On 11/08/05, Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> wrote: > > One that you missed was that this syntax: > > > >my Dog $spot .=new(); > > > > Falls out of it quite naturally. > > Actually I tried to mention that indirectly,

Re: Typed type variables (my Foo ::x)

2005-08-11 Thread Autrijus Tang
On Thu, Aug 11, 2005 at 08:02:00PM +1000, Stuart Cook wrote: > What's the current meaning of type annotations on type-variables? > > For example, if I say... > > my Foo ::x; > > ...which of these does it mean? > > a) ::x (<=) ::Foo (i.e. any type assigned to x must be covariant wrt. Foo) >

Re: Perl 6 Summary for 2005-08-02 through 2005-08-10

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 11:47:54PM -0400, Matt Fowles wrote: > Perl 6 Compilers >Pugs Argument Processing > Vadim Konovalov submitted a patch to pugs affecting @*ARGS processing. > Maybe it got applied, maybe not, Warnock applies. > In Pugs land, "Warnock" of

Re: Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:31:40PM +0200, TSa wrote: > >my $x is typed; > >$x = "123"; > >$x = length($x); > > > >Would be a type error. If it's in the dynamic world (as in Perl5), > >that's just fine. Does that difference make sense to you? > > The question remains, when exactly doe

Re: Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 09:29:38PM +0200, TSa wrote: > >Finally, it would get tedious to write them out by hand. So a lexical > >"traits" pragma may help: > > > >{ > > # Entering the realm of referential transparency... > > use traits < defined typed constant >; > > my $x; # autom

Re: Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 11:24:05AM -0700, Larry Wall wrote: > : My current understanding is that the typechecker considers IO to be of > : Class type, not of IO type; the fact that IO.does(IO) is true is purely > : an illusion created by special dispatch for .does. > > Well, that's what I thought

Re: $obj.meta.add_method('foo' => ???)

2005-08-10 Thread Autrijus Tang
On Tue, Aug 09, 2005 at 06:32:52PM -0400, Stevan Little wrote: > Now I realize that in perl 6 you can re-open classes and add methods to > them. However this is not convenient for programmatic class generation. Because of string eval, you mean? Well, some quasiquoting should fix that, but let's

my $pi is constant = 3;

2005-08-10 Thread Autrijus Tang
According to S06: my $pi is constant = 3; Is this a special form? If yes, what does it desugar to? my $pi is constant := 3; my $pi is constant ::= 3; If not a special form, should this work? my $pi is constant; $pi = 3; If yes, should this pass compilation? my $pi i

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 07:32:01PM +0200, TSa wrote: > you wrote: > >Perl 6 in its unannotated form is also (mostly) a typeless languages, > >with only the five builtin types, much like Perl 5 is. > > Counting the sigil quadriga as 4, what is the fifth element? & @ $ % :: In Perl5, :: is replac

Re: Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:25:05AM -0700, Larry Wall wrote: > I'll have to think about the rest of your proposal, but I was suddenly > struck with the thought that our "platonic" Class objects are really > forms of undef: > > say defined IO; # prints 0 Hmm, bool::false stringifies to '0'? Al

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:12:45AM -0700, Larry Wall wrote: > We can get away with this in Perl 6 because bindings to positionals > happen lazily. So all we have to check for syntactically is that we > don't have a subsequent declaration that changes the syntax from list > to unary (or none-ary).

Proposal: "is defined" trait, "is typed" trait, "traits" pragma.

2005-08-10 Thread Autrijus Tang
So I'm starting to write the inferencer. Immediately I encounter the problem that every type can potentially contain "undef": my IO $x = open('/etc/passwd'); $x = undef; $x.close; This raises the runtime error: *** Can't call method "close" on an undefined value. The "undef" li

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 06:03:18AM -0600, Luke Palmer wrote: > On 8/10/05, Autrijus Tang <[EMAIL PROTECTED]> wrote: > > But it's an toplevel optimization, which is not applicable to > > module authors. So I'd very much welcome a lexical pragma that > > forc

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:47:47AM +0200, Juerd wrote: > Larry Wall skribis 2005-08-09 16:19 (-0700): > > So either something in the context tells us what "Foo" means, or > > it will be taken as a list operator that hasn't been declared yet. > > Is there, by the way, a pragma to force predeclarati

Re: Hoisting lexical declarations

2005-08-09 Thread Autrijus Tang
On Tue, Aug 09, 2005 at 12:33:48PM -0700, Larry Wall wrote: > : Alternatively, this could raise a warning and treat the second my() > : as a no-op. Personally, I'm in favour of an exception. > > I think the exception should certainly be the default, perhaps with > the other behavior pragmatically

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-09 Thread Autrijus Tang
On Tue, Aug 09, 2005 at 06:36:28PM +0200, TSa wrote: > But Smalltalk is a typeless language that dispatches along the lines > of the (meta)class/(meta)object links. I propose to call this kind > of thing slot dispatch and reserve single and multi method dispatch for > the type based approach. Don't

Re: Container model - pictures and questions

2005-08-09 Thread Autrijus Tang
On Tue, Aug 09, 2005 at 02:06:58PM +0200, TSa wrote: > >The first one is about the compilation cycle: > > > >http://pugscode.org/images/simple-compilation.png > > Question: where is the namespace in the picture? > I would expect it to be build in parallel to the > syntax tree between parser an

Re: [DOCS] Updated intro.pod

2005-08-09 Thread Autrijus Tang
On Mon, Aug 08, 2005 at 12:03:25AM +0100, Jonathan Worthington wrote: > So, I re-wrote it. It now talks about PIR, and has examples in PIR. It > mentions how PIR differs from PASM. Subroutines now get a look in to the > introduction, and it mentions in passing that Parrot is capable of doing O

Re: Container model - pictures and questions

2005-08-08 Thread Autrijus Tang
On Mon, Aug 08, 2005 at 06:04:51PM +0200, "TSa (Thomas Sandla�)" wrote: > Autrijus Tang wrote: > >If I'm mistaken, please let me know, preferably by suggesting > >new arrangements on the diagram. :-) > > Without judging your mistakes, here are my comments t

Re: PXPerl 5.8.7-4 released with Windows binaries of Pugs 6.2.9

2005-08-08 Thread Autrijus Tang
On Mon, Aug 08, 2005 at 09:39:41AM -0400, Robert wrote: > Here is a question out of ignorance then. I currently use ActiveState but > the ability to use CPAN vs PPM is kind of nice. Since AS only releases stuff > as binaries, they work. Since I have to compile with PXPerl am I going to > have probl

Re: PXPerl 5.8.7-4 released with Windows binaries of Pugs 6.2.9

2005-08-08 Thread Autrijus Tang
On Mon, Aug 08, 2005 at 08:58:39AM -0400, Robert wrote: > Just started here and I found PXPerl. What are the benefits of this over the > ActiveState version? Supposedly it's built with Intel C compiler, so it's a bit faster; also you can choose among VC++, GCC and Intel C to compile further CPAN m

Re: Container model - pictures and questions

2005-08-08 Thread Autrijus Tang
On Sun, Aug 07, 2005 at 10:58:01PM +0100, Tim Bunce wrote: > What's missing from the description is that there's some form of > 'pointer' from a container to the cell it currently contains. > (I'm trying to avoid using the term reference.) I have updated the picture. It it marked as "(v2)":

Re: Container model - pictures and questions

2005-08-07 Thread Autrijus Tang
On Sun, Aug 07, 2005 at 10:58:01PM +0100, Tim Bunce wrote: > > The Container either has-a mutable cell, or has-a constant cell. > > > > my $mut = 3; > > my $con := 3; > > > > Use ":=" to change the cell inside a container: > > How about: > > Use ":=" to change the container to have a

Re: The meaning of "returns"

2005-08-06 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 03:52:41PM +0200, "TSa (Thomas Sandla�)" wrote: > >And this is a natural extension to guide the inferencer so it won't be > >totally giving up on polymorphic functions such as &id. C) and D) can > >be taken together, resulting to a powerful soft typed language. > > This is

Re: Container model - pictures and questions

2005-08-06 Thread Autrijus Tang
On Sat, Aug 06, 2005 at 12:43:13PM -0400, Matt Fowles wrote: > The pictures are pretty and the compilation one makes a great deal of > sense, but I must admit to being enitrely confused by the container > one. I think part of the problem is that I don't have a good footing > from which to understa

Container model - pictures and questions

2005-08-06 Thread Autrijus Tang
(Cc'ing p6l, but this feels like a p6c thread...) Greetings. As I'm moving forward with the new PIL runcore, I'm now trying to document my understanding as visual diagrams. The first one is about the compilation cycle: http://pugscode.org/images/simple-compilation.png The second one is abo

Re: Unable to run perl 6 test under Parrot 0.2.x

2005-08-05 Thread Autrijus Tang
On Sat, Aug 06, 2005 at 01:51:17AM +0400, Andrew Shitov wrote: > > Parrot 0.2.3 "Serenity" Released! > > Possibly I'm growling again but I cannot run any Perl 6 programme with > new Parrots. > > One-liner test.p6 containing 'print "perl 6";' is compiled to test.imc and > cause an error: The REA

Re: Whitespace (Was: [RELEASE] Pugs 6.2.9 released!)

2005-08-04 Thread Autrijus Tang
On Thu, Aug 04, 2005 at 10:55:12AM +0400, Andrew Shitov wrote: > why do we have to give up a space when calling functions under Pugs? > > A need to type open('file.txt') instead of open ('file.txt') makes > me perplexing (not perl-flexing ;-) Our recent discussions in 'zip with()' > gave no answer

[RELEASE] Pugs 6.2.9 released!

2005-08-03 Thread Autrijus Tang
I am glad to announce Pugs 6.2.9, released during Ingy's OSCON talk: http://pugscode.org/dist/Perl6-Pugs-6.2.9.tar.gz SIZE = 1439642 SHA1 = efd32419dcddba596044a42564936888a28b3c69 Following last month's plan, this release features a Perl6/PIL to javascript code generator, written in

Re: Complete type inferencing

2005-08-01 Thread Autrijus Tang
On Tue, Aug 02, 2005 at 12:49:06PM +1000, Brad Bowman wrote: > > 1. Asserted > > > > The usual case for Perl 6 functions, due to its default "Item" > > signature for parameters. In the example below, I assume that ::* > > cannot > > be changed freely to do away with ::*IO at runtime.

Re: sub foo ($x) returns ref($x)

2005-08-01 Thread Autrijus Tang
On Mon, Aug 01, 2005 at 03:16:50PM +0200, "TSa (Thomas Sandla�)" wrote: >sub equitype ( ::a $x, a $y) { ... } That's not a bad idea at all. I rather like it. I'd just still like an explicit type-unifying parens around ::a, just so people won't say sub foo (::Int $x) { ... } and acciden

Hoisting lexical declarations

2005-07-31 Thread Autrijus Tang
Pugs did not support inline variable declarations, largely because the problem caused by this construct: { say "values of β will give rise to dom!"; $x = $x + my $x if $x; #1 #2 #3#4 } The evaluation order for the four $x is (#4, #2, #3, #1). However, be

Eliminating &{} and *{}

2005-07-31 Thread Autrijus Tang
Under my current design of containers (see "definition of containers" on p6c), there are only Scalar, Array and Hash containers. This is in accordance to them being the only first-class data structures that deals with mutable data storage. This is similar to JVM's division between scalar data and

Re: Definition of containers.

2005-07-30 Thread Autrijus Tang
On Sun, Jul 31, 2005 at 02:00:13PM +1200, Sam Vilain wrote: > Tieing a hash would be the same as sub-classing it Sub-classing a container is exactly what tying is all about. That, and not losing the original non-tied storage inbetween ties. > Or is this merely a mechanism for the above? You can

Definition of containers.

2005-07-30 Thread Autrijus Tang
I have just checked in the container type part of the new PIL runcore: http://svn.openfoundry.org/pugs/src/PIL.hs In the Pugs directory, you can run a sample test with: *PIL> tests ==> %ENV =:= %ENV; True ==> %ENV =:= %foo; False ==> untie(%ENV); my %foo := %ENV;

Re: Binding scalars to aggregates

2005-07-30 Thread Autrijus Tang
On Sat, Jul 30, 2005 at 09:40:11AM -0700, Larry Wall wrote: > Right, so I guess what really happens is ref autogeneration in that > case, and there's no difference between > > $x = @array; > $x := @array; > > Hey, who said anything about consistency? :-) Hm, not exactly. This form:

sub foo ($x) returns ref($x)

2005-07-30 Thread Autrijus Tang
Suppose we have a function that takes an argument and returns something with the same type as that argument. One previous suggestion is this: sub identity ((::a) $x) returns ::a { return(...) } This is fine if both invariants in the "the meaning of 'returns'" thread are observed, since the i

Re: Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 12:53:03PM -0700, Brent 'Dax' Royal-Gordon wrote: > Autrijus Tang <[EMAIL PROTECTED]> wrote: > > In S06's Currying section, there are some strange looking examples: > > > > &textfrom := &substr.assum

Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
In S06's Currying section, there are some strange looking examples: &textfrom := &substr.assuming(:str($text) :len(Inf)); &textfrom := &substr.assuming:str($text):len(Inf); &woof ::= &bark:(Dog).assuming :pitch; Why is it allowed to omit comma between adverbial pairs, and even omit

Re: Complete type inferencing

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 06:36:45PM +0200, "TSa (Thomas Sandla�)" wrote: > you wrote: > >Interested readers can consult Manfred Widera's similar work for Scheme, > >in his "Complete Type Inference in Functional Programming" paper. > > Uih, you call a 300 page book a paper? I'm impressed. Well, it'

Complete type inferencing

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 04:59:21AM +0800, Autrijus Tang wrote: > However, my intuition is that a soft-typed system, with clearly defined > dynamic parts translated to runtime coerce and dependent types, that can > work exactly as Perl 5 did at first, but provide sensible inferencing >

Re: Elimination of Item|Pair and Any|Junction

2005-07-28 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 05:59:43AM +0800, Autrijus Tang wrote: > I can see marking things explicitly for named bindings: > > foo(:literal); > foo(*%nameds); > foo(*$pair); > foo([EMAIL PROTECTED]); Er, sorry, the last one should be foo(*%{ hash @list_of

Re: Elimination of Item|Pair and Any|Junction

2005-07-28 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 09:27:00AM -0700, Larry Wall wrote: > Or maybe Any really does mean "Object" and we're just viewing our > hierarchy too strictly if we make every relationship "isa". That's one > thing that neither this formulation nor Thomas's are making very > clear--which type relations

Some thoughts on PIL

2005-07-28 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 06:31:34PM +0200, "TSa (Thomas Sandla�)" wrote: > BTW, where can I read about PIL, other then in Parrot/Pugs svn? (Cc'ing in P6C.) The current type-indexed design of PIL is going away, because it is closely tied to the PIR/Parrot model, to the disadvantage of our Perl5/Jav

Inferring (Foo of Int).does(Foo of Any)

2005-07-27 Thread Autrijus Tang
As Perl 6's aggregate types are generics (Role that takes type parameters), the problem of type variancy naturally arises. The basic premise is that: 1. (Array of Item).does(Array of Int); # false 2. (Array of Int).does(Array of Item); # also false! Intuitively, while an (Array

Re: The meaning of "returns"

2005-07-27 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 05:57:28AM +0800, Autrijus Tang wrote: > On Thu, Jul 28, 2005 at 05:03:05AM +0800, Autrijus Tang wrote: > > Hence, it seems to me that there are only four ways out: > > Some annotations copied from discussion in #perl6: Last time I reply to myself

Re: The meaning of "returns"

2005-07-27 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 05:03:05AM +0800, Autrijus Tang wrote: > Hence, it seems to me that there are only four ways out: Some annotations copied from discussion in #perl6: > A) Omit the #3 check from compile time; at runtime, use the actual > type of $x. The "returns&qu

Re: Elimination of Item|Pair and Any|Junction

2005-07-27 Thread Autrijus Tang
On Thu, Jul 28, 2005 at 03:55:55AM +0800, Autrijus Tang wrote: > Hrm. I thought the original motivation of forcing people to write > > Any|Junction > > was precisely to discourage people from accidentally write > > sub foo (Any $x) > > and have $x accept

The meaning of "returns"

2005-07-27 Thread Autrijus Tang
Consider this: sub id (Any $x) returns Any { return($x) } sub length (Str $y) returns Int { ... } length(id("abc")); Under standard static subtyping rules, this call will perform three different typechecks: 1) "abc".does(Any) # ("abc" as Str) ===> (Any $x) in &id 2) $x.does(A

Re: Elimination of Item|Pair and Any|Junction

2005-07-27 Thread Autrijus Tang
On Wed, Jul 27, 2005 at 09:12:00AM -0700, Larry Wall wrote: > Yes. The only thing I don't like about it is that any() isn't an Any. > - Object > - Mumble > - Item > - ...pretty much everything > - Pair > - Junction > - num, int, str... Hrm.

Re: Elimination of Item|Pair and Any|Junction

2005-07-27 Thread Autrijus Tang
On Wed, Jul 27, 2005 at 12:19:10PM -0400, Matt Fowles wrote: > While we are talking about words... I dislike having Object encompass > Juction. I get the feeling that some people will write functions that > take Objects and not expect Junctions to slip in. I suppose that > could be one of those h

Elimination of Item|Pair and Any|Junction

2005-07-27 Thread Autrijus Tang
On Fri, Jul 22, 2005 at 03:40:34PM -0700, Larry Wall wrote: > I dunno. I'm inclined to say that it should default to Item|Pair, and > let people say Any explicitly if they really want to suppress autothreading. > Otherwise conditionals and switches are going to behave oddly in the > presence of "a

End-of-program global destruction is now guaranteed

2005-07-26 Thread Autrijus Tang
Heya. This is just a heads-up in response to your r5759: -- r23564 (orig r5759): chromatic | 2005-07-23 03:30:54 +0800 Added tests for global destruction: call DESTROYALL() on all active objects. (This is the last feature Test:

Re: [PATCH] Perl 6 FAQ

2005-07-25 Thread Autrijus Tang
On Sat, Jul 23, 2005 at 11:53:01AM -0700, Robert Spier wrote: > Thanks, applied. Thanks! However, the rendered form is still of an old revision: http://dev.perl.org/perl6/faq.html Cheers, /Autrijus/ pgp31aL1GpSEb.pgp Description: PGP signature

[PATCH] Perl 6 FAQ

2005-07-20 Thread Autrijus Tang
Below is a patch to remove the first Q&A from: http://dev.perl.org/perl6/faq.html Against its source form: http://svn.perl.org/perl.org/docs/live/dev/perl6/faq.pod I tried to think of a rewrite to replace the two outdated assertions, but failed miserably. Thanks, /Autrijus/ Index: faq

Re: Is namespace qualification really required

2005-07-19 Thread Autrijus Tang
On Tue, Jul 19, 2005 at 01:58:18PM -0500, [EMAIL PROTECTED] wrote: > Now I want to contribute an example. It shows off named parameters with > default values (including those of code type :-) as well as currying. It > does this by implementing Newton's method for root finding. Is this > appro

Re: Is namespace qualification really required

2005-07-19 Thread Autrijus Tang
On Tue, Jul 19, 2005 at 12:53:19PM -0500, [EMAIL PROTECTED] wrote: > Thanks for working on this, but there is still a problem. > > When I run make test, the two tests both pass. When I run the test as: > > perl -Iblib/lib t/subroutines/defaults.t "perl"? > I get errors: > 1..2 > ok 1 - default

Re: Is namespace qualification really required

2005-07-19 Thread Autrijus Tang
On Mon, Jul 18, 2005 at 02:47:06PM -0500, [EMAIL PROTECTED] wrote: > I did this. I included two tests, one without multiple packages (which > works) and one with them (which fails). I marked the second test todo. ...and I fixed the bug promptly. :) > Thanks for the gentle help with this proces

Re: Strange interaction between pairs and named binding

2005-07-18 Thread Autrijus Tang
On Mon, Jul 18, 2005 at 03:48:55PM -0700, Brent 'Dax' Royal-Gordon wrote: > Autrijus Tang <[EMAIL PROTECTED]> wrote: > > This currently works in Pugs: > > > > for [1..10].pairs -> Pair $x { say $x.value } > > > > But this does not

Re: Is namespace qualification really required

2005-07-18 Thread Autrijus Tang
On Mon, Jul 18, 2005 at 09:00:50AM -0500, [EMAIL PROTECTED] wrote: > I made the test. The problem only occurs when the sub is called from > another package, in my case that was a driving script. > > I'm not sure how to accept the invitation (or what that even means). Oh. It means you should

  1   2   3   4   >