Code Monkey home page Code Monkey logo

Comments (2)

wyld-sw avatar wyld-sw commented on August 14, 2024

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.

  • SET - sets or resets a single flag
  • FLAG? - checks for a single flag

These new primitives would check for multiple flags.

  • SETFLAGS - sets or resets at least one flag - no aliases
  • FLAGS? - returns 1 if all the given flags in the argument string are (re)set, else 0

These MPI functions could be analogs of the above.

  • {set} / {flag?} for the single-flag case. Not strictly needed, but consistency can be good.
  • {setflags} / {flags?} for multiple flags

And finally...

  • @flagset to set multiple flags via a command. I thought the name could mirror @propset, but there's a case for making it @setflags.

Or...

  • We could make the single-flag versions recognize multiples, though that seems messy for the current primitives.

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!

from fuzzball.

tanabi avatar tanabi commented on August 14, 2024

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!

from fuzzball.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.