boxlambda icon indicating copy to clipboard operation
boxlambda copied to clipboard

Immediacy of `immediate`

Open ruv opened this issue 3 months ago • 4 comments

https://github.com/epsilon537/boxlambda/blob/63364d999c8ee9c59b2ecf18c7c1a9c4021152ed/sw/projects/mforth/included-tools.fs#L44

It seems, your word immediate has attribute "immediate". Note that the standard word immediate is not immediate.

To reduce confusing, it is better to rename your word to [immediate]. See also a discussion at ForthHub.

ruv avatar Nov 05 '25 14:11 ruv

Thanks. I'll consider that. I'll have to decide whether I'm shooting for standard compatibility or Mecrisp Forth compatibility. In either case, some part of the potential audience is going to be confused.

Thanks for the link to ForthHub. That's a great resource!

I also want to point out that the file you dug up is not part of an 'official' BoxLambda build yet. The mforth build is just a rough prototype/test build I've been using to evaluate Mecrisp Forth on my system.

epsilon537 avatar Nov 06 '25 15:11 epsilon537

I'll have to decide whether I'm shooting for standard compatibility or Mecrisp Forth compatibility.

The word immediate is not immediate in Forth-79, Forth-83, Forth-94, Forth-2012. It's a shame Mecrisp Forth introduced this incompatibility. A different name for the immediate variant would have been sufficient.

In either case, some part of the potential audience is going to be confused.

It seems, using [immediate] is not confusing.

ruv avatar Nov 16 '25 11:11 ruv

Alright. In the BoxLambda version I'll switch to [immediate]. I take it the same goes for the following flags, which are all immediates:

    inline          ( -- ) Makes current definition inlineable.
    noframe         ( -- ) No need to push/pop link register when compiling this definition.
    compileonly     ( -- ) Makes current definition compileonly.

epsilon537 avatar Nov 18 '25 15:11 epsilon537

Yes, I would also name these words in the form [foo]: [inline], [noframe], [compileonly], since they are immediate, and they do not affect the semantics of the definition body, in which they are used (intentionally). That is, it is better if they do not look like ordinary words.

ruv avatar Nov 19 '25 08:11 ruv