[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [epsilon-devel] Questions

From: Luca Saiu
Subject: Re: [epsilon-devel] Questions
Date: Mon, 30 Dec 2013 02:56:44 +0100
User-agent: Gnus (Ma Gnus v0.8), GNU Emacs, x86_64-unknown-linux-gnu

On 2013-12-29 at 23:02, address@hidden wrote:

> 6) What does e0:primitive is?

e0:primitive is an epsilon0 syntactic form letting you call a
primitive.  e1:primitive is just an alias of e0:primitive, since in
epsilon1 the concept is identical.

So, for example, since fixnum:+ is a primitive, you can call it like
(e0:primitive fixnum:+ 2 4).

> (e1:define (buffer:make element-no)
>   (e0:primitive buffer:make element-no))
> Can you explain the above procedure?

It's very cumbersome to write e0:primitive explicitly, and it's very
easy to forget what is a primitive and what it's not.  So, I defined
procedure wrappers for primitives.  This way I can write either
(buffer:make 4)
(e0:primitive buffer:make 4)
.  Both will work.

Notice that a symbol can be bound to a primitive and a procedure at the
same time.  You'll notice that it can be bound to other things as well,
again at the same time: a global, a macro.  This comes in handy, but
it's actually a consequence of how symbols are implemented: it's each
symbol which contains its associated global values.  A symbol is
essentially a record holding these fields, with the uniqueness property.

> Where buffer:make is defined in
> the final implementation of epsilon?

The real definition of buffer:make is in C; it could be an assembly
wrapper instead, but however still out of epsilon0.  This is what a
primitive is: just like a procedure, but implemented out of epsilon at a
lower level.

Good night,

Luca Saiu
Home page:   http://ageinghacker.net
GNU epsilon: http://www.gnu.org/software/epsilon
Marionnet:   http://marionnet.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]