Role of primitive? WAS Re: [plt-scheme] apply

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jun 22 17:08:21 EDT 2009

On Jun 22, Grant Rettke wrote:
> Is 'primitive?' a function that is provided as a mean for users to get
> a sense of what parts of the implementation are implemented in
> not-Scheme, and what are?
> 
> How do you normally utilize 'primitive?'?

Normally, you don't.

The distinction between those functions that are `primitive' and those
that are not has become less important in time.  These days, the
difference might be useful in some obscure low-lever code, but not
much else.  Specifically, the primitive-ness of a function is not part
of its interface and things do move -- for example, at some point
Matthew switched `map' from a primitive to being defined in Scheme
(and this was mostly unnoticed).


> On Mon, Jun 22, 2009 at 3:47 PM, Skeptic .<skeptic2000 at hotmail.com> wrote:
> >
> > Hi,
> > (procedure? apply)
> > #t
> > (primitive? apply)
> > #f
> > How/where is implemented apply in PLT Scheme ?

The reason for this is that `apply' in the `scheme' language is a
Scheme function deals with keyword arguments.  It is a wrapper on top
of the primitive one -- which you can still see if you use the
`mzscheme' language.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.