Hi Alexander,

The "primitive registration system" is a little more involved than
PRIMITIVE: but we defined that as syntax so we could grep and keep track of
our primitives better and as a placeholder for some future cleanup.

When you make a new "primitive", it needs several things including this in
Factor (which we hope PRIMITIVE: will replace someday):

    * core/bootstrap/primitives.factor (make-primitive)
    * basis/stack-checker/known-words/known-words.factor (define-primitive)

And this in the VM:

    * vm/vm.hpp (defined)
    * vm/primities.hpp (exported)
    * vm/*.cpp (implemented)

We have an issue for improving this, although we won't likely get to it
right away:

    https://github.com/slavapestov/factor/issues/1134

Thanks,
John.




On Tue, Sep 15, 2015 at 2:03 AM, Alexander Ilin <ajs...@yandex.ru> wrote:

> Hello!
>
>   I was looking at some words, like <wrapper>, and I saw PRIMITIVE:
>
> IN: scratchpad \ <wrapper> see
> IN: kernel
> PRIMITIVE: <wrapper> ( obj -- wrapper ) foldable flushable
>
>   But when I tried to look up PRIMITIVE:, here's what I saw:
>
>   If I do IN: scratchpad \ PRIMITIVE: see
> USING: kernel ;
> IN: syntax
> SYNTAX: PRIMITIVE:
>     "Primitive definition is not supported" throw ;
>
>   Is this the actual definition of PRIMITIVE:? To throw an error? How can
> the <wrapper> work then?
>
>   If it is not the actual definition, please help me find the real one.
>
> ---=====---
>  Александр
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
------------------------------------------------------------------------------
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to