fuzzball-muck / fuzzball

Ongoing development of the Fuzzball MUCK server software and associated functionality.
Other
46 stars 26 forks source link

Add flag? MPI Function #717

Open tanabi opened 8 months ago

tanabi commented 8 months ago

This is the equivalent to the flag? MUF prim.

Calling signature:

{flag?:#ref,str}

where 'str' is one or more flags to test for. 'M' flag will ignored and a number will be used for MUCKER bits. So, thusly:

{flag?:#123,ACBM3}

and

{flag?:#123,ACB3}

are equivalent. This isn't a hard requirement; if there's an existing library function we can use to check multiple flags by string (I don't remember off the top of my head, but check around first!) then use it and have the function work whatever way the existing code works. But I'm about 80% sure there's not an existing call.

Returns boolean true if all flags match, boolean false if any flag isn't set.

wyld-sw commented 8 months ago

I think all flag-checking is currently for one flag only. In fact, since FLAG? also needs to recognize flag aliases, I was going to propose this suite of flag-manipulation processes:

These primitives already exist but recognize aliases.

These new primitives would check for multiple flags.

These MPI functions could be analogs of the above.

And finally...

Or...

I'm currently trying to unify all flag management functions under the hood (slow-going), so this is very relevant. I haven't added an issue yet since I'm still working on the approach. Feel free to, though, if you think the flag code needs updating too!

tanabi commented 8 months ago

This all sounds very sensible to me. I think @flagset is fine; @setflags does have a logic to it, but I think the consistency with @propset is good and I anticipate that being kind of a rarely used command. In fact, I'd say do it only if its easy, I don't think its really worth a high degree of effort. Especailly since it would be trivial to implement in MUF if someone wants it given the new prims.

The rest, looks good to me!