RhostMUSH / trunk

RhostMUSH 4.0: This is the official main repository of RhostMUSH. Visit us at rhostdev.mushpark.com 4201
23 stars 21 forks source link

train / ] evaluation #151

Closed warmstarter closed 3 years ago

warmstarter commented 3 years ago

These are some examples of use of train/]

I think that the main oddity is that train is evaluating stuff in between [ ] which is different behavior than ] on it's own. The train help file mentions no-evaluation, though it doesn't have the example of the function in-between [ ] that ] has. I'm not sure if there's a reason for train behaving differently. It should either be a code update or a help file update. If it is the latter, let me know and I'll handle it.

There's also things getting evaluated when using ] or train with softcode commands like 'ooc' which makes sense why that would happen, but should probably be clarified in the help file as well. Happy to do to that as well, but going to wait to hear back on the train issue before doing anything there.

train think test add(1,1)

Luu types -=> think test add(1,1)

test add(1,1)

train think test [add(1,1)]

Luu types -=> think test [add(1,1)]

test 2

] think test add(1,1)

test add(1,1)

] think test [add(1,1)]

test [add(1,1)]

train ooc test add(1,1)

Luu types -=> ooc test add(1,1)

Luu says, "test add(1,1)" train ooc test [add(1,1)] Luu types -=> ooc test [add(1,1)] Luu says, "test 2"
Chalice commented 3 years ago

Hmmh, not seeing any issue or unexpected behavior here, really.

] stops evaluation.

'train' just displays to others what you typed, before processing it normally with evaluation.

You'll also find that functions without the []'s evaluate fine - there is a condition to it, though. The function() without square brackets either needs to be the first part of a command's argument, or be at the start of a function parameter.

So, add(add(1,1),add(1,1)) will evaluate to add(2,2) and then eval that to 4, but add(blah add(1,1),add(1,1)) would evaluate to add(blah add(1,1),2) and then eval to an error about args needing to be numbers.

Nothing of this is particularly out of the ordinary for MUSH.

warmstarter commented 3 years ago

I think this was what was weird to me:

Luu types -=> think test add(1,1) test add(1,1) Luu types -=> think test [add(1,1)] test 2

versus

Luu types -=> think add(1,1) 2 Luu types -=> think [add(1,1)] 2

but it sounds like this is expected behavior in general, and just something I hadn't realized, based on what you're saying, so I'll close this.