TodePond / MotherTode

language language
MIT License
21 stars 1 forks source link

Remove chain operator #12

Closed TodePond closed 2 years ago

TodePond commented 2 years ago

The chain operator is kinda confusing, and I think its uses could be fulfilled by an upcoming 'then' operator instead. So maybe remove it?

Magnogen commented 2 years ago

What sets the chain operator apart from the then operator?

TodePond commented 2 years ago

You used the ++ chain operator as part of a term definition. But the ... then operator can be used as part of a match sequence, so should be more intuitive.

With the chain operator:

Language (
    ++ Sanitise
    :: Expression
)

With the then operator:

Language :: Sanitise ... Expression
Magnogen commented 2 years ago

Hmm, yes I can see why that would be intuitive, but I can't help but shake the feeling that ... means that something else is omitted between the terms, like "This term makes no difference, it can be anything". Maybe using a , could work instead?

Also, maybe an "anything" operator could be implemented, to make use of the ... syntax?

TodePond commented 2 years ago

Yes that's true! A different thing would probably be better. The language has really turned into 'symbol hell' so maybe even then would be good.

Language :: Sanitise, Expression
Language :: Sanitise then Expression
Language :: Sanitise & Expression
Language :: Sanitise && Expression
Language :: Sanitise and Expression
Magnogen commented 2 years ago

I think then would probably work best actually, as it's clearer as to what it does, whereas and could be interpreted as a sequence of terms, which in actuality is just a space

TodePond commented 2 years ago

I'll try it out!

Also, maybe the 'any' keyword/symbol could be 'anything that is not the following term'. I'd need to make a 'not' operator or something. Not sure how it would totally work though 🤔

TodePond commented 2 years ago

Closing because of upcoming rewrite