Re: I'll show you mine...

2002-04-11 Thread Dan Sugalski

At 7:25 AM -0700 4/11/02, Randal L. Schwartz wrote:
   Dan == Dan Sugalski [EMAIL PROTECTED] writes:

Dan (Or maybe attributed string eval, like:

Dan  $foo = eval.Parrot EOP
Dan   set I0, 12
Dan   sub I0, I0, 5
Dan   EOP

That would make more sense to me (for whatever that's worth) as

$foo = Parrot.eval EOP;
   set I0, 12
   sub I0, I0, 5
   EOP

Or am I missing something?

I was thinking we'd be throwing an attribute on string eval telling 
it which parser rules to use (hence the .Parrot on the end, which is 
probably the wrong syntax) rather than having each set of parser 
rules be a separate class with an eval method.

The syntax probably should've been eval is Parrot or something like that.
-- 
 Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
   teddy bears get drunk



Re: I'll show you mine...

2002-04-10 Thread Piers Cawley

In message [EMAIL PROTECTED], I wrote:
 [ A huge wodge of possible perl 6 code ]

I'm getting that Warnock's Dilemma feeling here... Did I stun you all
into silence?

-- 
Piers

   It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite.
 -- Jane Austen?




Re: I'll show you mine...

2002-04-10 Thread Dan Sugalski

At 3:03 PM +0100 4/10/02, Piers Cawley wrote:
In message [EMAIL PROTECTED], I wrote:
  [ A huge wodge of possible perl 6 code ]

I'm getting that Warnock's Dilemma feeling here... Did I stun you all
into silence?

Nah. You just can't hear the people running away screaming from there. ;-P
-- 
 Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
   teddy bears get drunk



Re: I'll show you mine...

2002-04-10 Thread Aaron Sherman

On Wed, 2002-04-10 at 10:03, Piers Cawley wrote:
 In message [EMAIL PROTECTED], I wrote:
  [ A huge wodge of possible perl 6 code ]
 
 I'm getting that Warnock's Dilemma feeling here... Did I stun you all
 into silence?

On my clock, your original message arrived at 04:23, and your followup
at 10:03. On the west coast of the US, that would be 01:23 to 07:03.
That's probably the time you're least likely to get responses.

Personally, I'm a little stunned. I wish I could load it into a
debuggger ;-)

Your idea at the end of regugitating the code back out as Parrot or Perl
is just slightly stunning on its own.

Still digesting





Re: I'll show you mine...

2002-04-10 Thread Dan Sugalski

At 3:49 PM +0100 4/10/02, Piers Cawley wrote:
Aaron Sherman [EMAIL PROTECTED] writes:
   Your idea at the end of regugitating the code back out as Parrot or Perl
  is just slightly stunning on its own.

I thought that was the easy bit. The compiler just (for appropriate
values of 'just' of course) walks the syntax tree and uses an
appropriate code generator to output appropriate source, which is what
compilers have been doing since the year dot surely.

We're going to have to put the asm keyword in for you, aren't we? :)

(Or maybe attributed string eval, like:

 $foo = eval.Parrot EOP
set I0, 12
sub I0, I0, 5
EOP

Now that'd be interesting. Any parser module could be used. Hmmm)
-- 
 Dan

--it's like this---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
   teddy bears get drunk



Re: I'll show you mine...

2002-04-10 Thread Melvin Smith

At 09:23 AM 4/10/2002 +0100, Piers Cawley wrote:
Okay, this is the beginnings of Scheme in Perl6. I'm sure there's
stuff I'm getting wrong. I've not written the parser yet for instance

Very nice! Quite a sample, maybe Larry/Damian can use this
in one of the next $(A,E)'s


   my SchemeExpr $.value;

I haven't been keeping up in the back, I've a wedding bearing down on me.

What is the significance of the . in the declaration? I think I paid attention
enough to know a little about the unary dot but I'm still confused.
We are able to use .foo to mean self.foo, but I would assume foo would be
declared with my Foo $foo, not my Foo $.foo ?

   method car { .value.key }
   method cdr { .value.value }

Maybe its the C++ in me but why the use of the unary . inside methods
of the current class who's scope includes Cvalue already?

Isn't this like using Cthis in C++ from inside a non-static method?

I'll await your ruler on my knuckles, but overall; very impressed here.

-Melvin




Re: I'll show you mine...

2002-04-10 Thread Piers Cawley

Melvin Smith [EMAIL PROTECTED] writes:

 At 09:23 AM 4/10/2002 +0100, Piers Cawley wrote:
Okay, this is the beginnings of Scheme in Perl6. I'm sure there's
stuff I'm getting wrong. I've not written the parser yet for instance

 Very nice! Quite a sample, maybe Larry/Damian can use this
 in one of the next $(A,E)'s


   my SchemeExpr $.value;

 I haven't been keeping up in the back, I've a wedding bearing down on me.

 What is the significance of the . in the declaration? 

  class Class {
my $class_variable;
my $.instance_variable;

...
  }

Easy eh?

 I think I paid attention enough to know a little about the unary dot
 but I'm still confused.  We are able to use .foo to mean self.foo,
 but I would assume foo would be declared with my Foo $foo, not my
 Foo $.foo ?

   method car { .value.key }
   method cdr { .value.value }

 Maybe its the C++ in me but why the use of the unary . inside methods
 of the current class who's scope includes Cvalue already?

Consider 

  class SpecializedPair is SchemePair {
method value {...}
  }

If you've written 'cdr' without the unary . it will attempt to
dispatch to a *subroutine* in the same context, ie
SchemePair::value. Even assuming that we play nice and allow confusion
between methods and subroutines (which I'm personally not keen on),
it's still apparent that, in the case of a SpecializedPair, car and
cdr would use the wrong value.

 Isn't this like using Cthis in C++ from inside a non-static method?

Don't ask me. I know nothing about C++ -- Objective C (Looong ago),
Perl 5, Smalltalk and Ruby for me.

 I'll await your ruler on my knuckles, but overall; very impressed
 here.

Thanks. Wait for the next version though, I'm busy implementing
lexical scopes at the moment. 

-- 
Piers

   It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite.
 -- Jane Austen?




Re: I'll show you mine...

2002-04-10 Thread raptor

great idea :)

I've just tried gnuCash program and think it is very cool  (i've enjoyed to take 
first steps in double-entry accounting, i was always wondering what the hell is this 
:) )...
http://www.ncsysadmin.org/july2001/ncsa-gnucash-talk.html#toc1 
(very entertaining intro :) )

Meanwhile during browsing the docs i found that there was a way to extend the program 
but via Scheme (it had possiblity to be extended via perl at the begining but now not, 
for some their reason !!!). And so I wanted always to learn Prolog  Lisp and so now 
I'm reading the Scheme online book :
http://www.scheme.com/tspl2d/index.html

It looks very cool, so go for it... i hope i will  learn it :)

=
iVAN
[EMAIL PROTECTED]

PS. Before a couple of years I was using happily Windows and one my friend told me 
(arguing constantly ) do u know that Linux is very cool (no matter it used Win 
:)) .. so i got a book and started to learn Linux, i read about awk and started to 
write a report program (parsing IIS,proxy etc.. logs), meanwhile i constantly saw Perl 
examples in the same book, and also precaution that Perl is much more powerfull and 
hard to learn, so be prepared to spend alot of time. so one day i decided this awk 
is cute but what if i try Perl ? And on the third week my program much more 
featurefull was ready :) (up to this time i used only pascal  basic)
The good things always happen acidently .. 
So ... Thank you very much.