Updates to the tutorial

Pupeno pupeno at pupeno.com
Tue Aug 24 11:14:50 PDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Slaters...
I'm a newbie trying to learn Slate and to achieve that, I'm reading the 
tutorial: http://perso.wanadoo.fr/kodama/tutorial.html
This tutorial is obviusly outdated since it was written for Slate 0.2.1. As an 
effort to help whoever is in charge of that tutorial (there's no credits in 
that tutorial) I'm writting a small document specifying all I've found not to 
be accurate. In the cases where I can, I also write how it should be change 
it, where I can't, I write whatever I can for who is going to change it. I 
trully hopes it helps.
I was using the wiki to do it, but I was told not to do it, but send it by 
mail, so, here it is what I have so far (I'll send more updates latter):

Introduction
============

Installation and Setup
======================

The tutorial was created for Slate 0.2.1 (as it is said at the begining of 
it). At that moment, Slated used to run over Lisp. Now (Slate 0.3.0), Slate 
has it's own virtual machine as it was expresed in the Introduction to Slate:
"Slate 0.3 will include a virtual machine, so that versions from 0.3 up will 
be self-hosting and no Lisp system necessary."
Personally, I'm not sure of all the changes that made, but the setup and 
installation seems to have changed a lot.
The current Slate Setup instruction should be something like:
 
$ tar xfz slate-0.3.tgz
$ cd slate-0.3
$ make
[Some lines of compiling]
$ ./vm little.image 
Slate: Growing heap to 4726380 bytes.
Hi, there!
Slate 1>

And that's it.
note: If you are in a big endian computer (x86s are little endian), you'll 
need to run ./vm big.image.
And that's it.

Slate's Object Model
====================

A Note on Syntax
- ----------------

In the table after "When methods from several categories are mixed, the order 
of precedence is that of the preceding rules. Evaluation always proceeds from 
left to right, so that:" I would put more examples. I would put mixes of 
unary and binary operator (in different orders) and mixes of unary, binary 
and keyword operators (in different orders). This examples are importart for 
newcomers. If I can, I'll try to create a table here with those examples.

Creating Slots
- --------------
After "Let us then create a new object, by simply adding a slot to the lobby 
to store that object:" the output of Slate is no logger the same, now it's 
like this:
> lobby addSlot: #myObject.
(Mixins . Types . prototypes . VM .
        globals . myObject . traits )
This voids the description that follows: "The line starting with 
<@Namespace: ...> is the printable description of the object returned by the 
operation, the lobby in our case. The description includes the kind of object 
returned (a Namespace in our case) and the list of its slots. As the lobby 
serves as the top-level in the hierarchy of namespaces used by Slate, it 
includes a slot pointing to itself (the slot called lobby)."
 
After the couple of lines above, the following is run:
> myObject.
Nil
If you latter want to explain that lobby is a delegrate object of the current 
object/context (like it is done), I think it would be bettar to call it like 
this:
> lobby myObject.
Nil

It seems
> removeSlotNamed: #myObject.
3
should now be 
> removeSlot: #myObject.
(Mixins . Types . prototypes . VM .
        globals . traits )

And again:
> addSlot: #myObject valued: 43.
(Mixins . Types . prototypes . VM .
        myObject . globals . traits )
> myObject.
43

And again, but in this case, appart of the example that is like this:
> addImmutableSlot: #x valued: 37.
(Mixins . Types . prototypes . VM .
        myObject . x . globals . traits )
> x: 43.
The following condition was signaled:
The method #x: was not found for the following arguments:
{(Mixins . Types . prototypes . VM .
                myObject . x . globals . traits ).
        43}

The following restarts are available:
0)      Inspect a stack frame
1)      Abort evaluation of expression
2)      Quit Slate
Debug [0..2]: 1
Nil
the last sentences of the paragraph (maybe more) should be changed from: "We 
can see the error message and the back-trace. Typing in 0 when prompted for a 
place to restart execution from sent us back to the REPL and cleared the 
exception." to: "We can see the error message. Typing in 1 when prompted for 
a place to restart execution from sent us back to the REPL and cleared the 
exception." (maybe that sentence needs a little reviewing as well). And 
maybe, this would be a good place to explain what "Inspect a stack frame" is 
(at least, an overview).
- -- 
Pupeno: pupeno at pupeno.com - http://www.pupeno.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBK4WdfW48a9PWGkURApoOAJ9HqnQZFN5AC/siQQFNSHsdBoIbYwCeK6DE
CJ82s/7Y0BV7M2nX2HB+nE0=
=xLeK
-----END PGP SIGNATURE-----




More information about the Slate mailing list