larsbrinkhoff / forth-mode

Wants to be the SLIME of Forth
GNU General Public License v3.0
61 stars 17 forks source link

Adding support for ?of #72

Closed tufty closed 7 years ago

tufty commented 7 years ago

Hi. forth-mode seemed to be missing the ?of … endof construct, this should add it.

larsbrinkhoff commented 7 years ago

Thank you.

This change fails the CASE indentation test. Can you look into that?

tufty commented 7 years ago

Ah, bugger, yes. I'll have a look.

tufty commented 7 years ago

That seems to have done the trick. Strangely, tests of indentation are susceptible to fail if you mess up the indentation...

larsbrinkhoff commented 7 years ago

Thanks! Merged.

ellerh commented 7 years ago

I'd like to remove this because ?of is not a standard word and it seems rarely used. In fact, I have no clue what it's supposed to do. Eventually there should be a convenient way to customize indentation and fontification. Ideally dependent on the search-order. Until then, users have to hack around things in forth-mode-hook or live with the disadvantages of non-standard words. Including every non-standard word in the wild is clearly not the way to go.

larsbrinkhoff commented 7 years ago

@tufty, do you have any input on this? Where have you seen ?of used?

tufty commented 7 years ago

Hi guys.

I was under the impression it was ANS, but it seems not. It’s certainly part of stellaris, which is mostly what I’m using.

As for usage, generally something like this

… CASE DUP EVEN ?OF … ENDOF … ( default ) ENDCASE

Thinking about it, it’s almost certainly more efficient to encode the case selector outside the case statement itself, especially if there is more than one ?OF, as you lose the extraneous DUP, viz

… DUP EVEN CASE TRUE OF … ENDOF … ( default ) ENDCASE

with a potential obfuscation of meaning..

Losing support for it isn’t really a problem WRT fontificaion, but for stuff used in control structures, failure to indent breaks everything horribly.

I dunno, really. I’m not a forth god...

Simon

On 14 Jun 2017, at 11:57, Helmut Eller notifications@github.com wrote:

I'd like to remove this because ?of is not a standard word and it seems rarely used. In fact, I have no clue what it's supposed to do. Eventually there should be a convenient way to customize indentation and fontification. Ideally dependent on the search-order. Until then, users have to hack around things in forth-mode-hook or live with the disadvantages of non-standard words. Including every non-standard word in the wild is clearly not the way to go.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.