ANNOUNCE: Joy in Scheme version 0.3

John Cowan — 2003-05-14 19:58:56

Okay, another day, another version.

This one implements modules. The syntax is:

(joy-module module1
private
(joy-define foo bar baz)
public
(joy-define abc foo)
(joy-define def foo)
exported
(joy-define xyz abc))

The module name is the first argument. Private means the definition is
obscured; public means the definition is qualified by the module name;
exported means the definition is unqualified. You can have multiple
instances of private, public, and exported. The default is public if
nothing is specified.

I have also defined cond and step, with a still-buggy definition of map.
Still waiting for comment and/or bug reports and/or fixes.

--
John Cowan jcowan@... www.reutershealth.com www.ccil.org/~cowan
"It's the old, old story. Droid meets droid. Droid becomes chameleon.
Droid loses chameleon, chameleon becomes blob, droid gets blob back
again. It's a classic tale." (Kryten, Red Dwarf)

John Hodge — 2003-05-14 20:35:45

[snip]

John Cowan writes:
> Still waiting for comment and/or bug reports and/or fixes.


I'll be looking at it closely tonight. Try to get back to you
tonight also.


--Hodge

John Hodge — 2003-05-14 20:39:49

--- In concatenative@yahoogroups.com, John Cowan <cowan@c...> wrote:
> Okay, another day, another version.

Is this at the same location as version 2? Same filename?


--Hodge

Heiko.Kuhrt@t-online.de — 2003-05-14 23:11:18

Am Mittwoch Mai 14 2003 21:58 schrieb John Cowan:
> I have also defined cond and step, with a still-buggy definition of
> map. Still waiting for comment and/or bug reports and/or fixes.


Hello John,
I think it works very well!

----- The following I had to insert in order to run it on stklos-scheme:
(define hashtable (make-hash-table))
(define (getprop key hash default) (hash-table-get hashtable key
default))
(define (putprop key hash value) (hash-table-put! hashtable key
value))

(joy-prim-void (include s) (load s )) ; SYSTEM-DEPENDENT ;;filename.stk

------
;;; And this is my first lib for joy.ss
(display "This is test.stk")
(joy-define newword 1 +)

(joy-define abort 1 0 /)
(joy-define joy-newline "\n" putchars)
(joy-define putln putchars "\n" putchars)
(joy-define putline putchars joy-newline)
(joy-define newputline joy-newline putline)
(joy-define someerror ;"ERROR: " swoncat
newputline putln abort)
(joy-define unpair uncons first)
(joy-define swonsd [swons] dip)
(joy-define swons2 swapd swons swonsd)
,, so far everything perfectly ok
(joy-define joy-reverse () swap (swons) step)
(joy-define unzip reverse [ [] [] ]dip [unpair swons2] step)
(joy (1 2 3 4) () step) ; I think here is something wrong? But it late
over here, I'm going to sleep now.

-Heiko

John Cowan — 2003-05-15 02:12:20

John Hodge scripsit:

> Is this at the same location as version 2? Same filename?

Yes, always.

--
Yes, chili in the eye is bad, but so is your John Cowan
ear. However, I would suggest you wash your jcowan@...
hands thoroughly before going to the toilet. http://www.reutershealth.com
--gadicath http://www.ccil.org/~cowan

John Hodge — 2003-05-15 13:42:18

--- In concatenative@yahoogroups.com, John Cowan <cowan@c...> wrote:
> John Hodge scripsit:
>
> > Is this at the same location as version 2? Same filename?
>
> Yes, always.
>

I couldn't find any errors running it in Chez Scheme. When I tried
to compile it with Bigloo, there seemed to be some minor snag with
the macro expansions. I haven't had time to track down what is
causing these, and I will be away from my PC for 4 or 5 days
(vacation). I'll look into this further when I get back (although,
at the rate you are progressing, it may all be done by then).

--Hodge

John Cowan — 2003-05-16 03:40:43

John Hodge scripsit:

> I couldn't find any errors running it in Chez Scheme. When I tried
> to compile it with Bigloo, there seemed to be some minor snag with
> the macro expansions. I haven't had time to track down what is
> causing these, and I will be away from my PC for 4 or 5 days
> (vacation). I'll look into this further when I get back (although,
> at the rate you are progressing, it may all be done by then).

Maybe, maybe not. :-)

I ran it successfully under the Chicken interpreter, but I haven't had a
chance to try the Chicken compiler yet (which uses C as intermediate).

--
John Cowan http://www.ccil.org/~cowan jcowan@...
Please leave your values Check your assumptions. In fact,
at the front desk. check your assumptions at the door.
--sign in Paris hotel --Cordelia Vorkosigan

John Cowan — 2003-05-16 12:40:27

Heiko.Kuhrt@... scripsit:
> Am Mittwoch Mai 14 2003 21:58 schrieb John Cowan:
> > I have also defined cond and step, with a still-buggy definition of
> > map. Still waiting for comment and/or bug reports and/or fixes.
>
>
> Hello John,
> I think it works very well!

Thanks. It wouldn't surprise me if there were bugs in "step" (or any
other primitive, for that matter).


--
De plichten van een docent zijn divers, John Cowan
die van het gehoor ook. jcowan@...
--Edsger Dijkstra http://www.ccil.org/~cowan

Steven Shaw — 2003-05-17 04:16:17

Seems to work under PLT-Scheme. Slightly modified Heiko's changes for
stklos-scheme:

(define hashtable (make-hash-table))
(define (getprop key hash default)
(hash-table-get hashtable key (lambda () default)))
(define (putprop key hash value)
(hash-table-put! hashtable key value))

Thanks!

Steve.