Code Monkey home page Code Monkey logo

Comments (2)

soveran avatar soveran commented on May 30, 2024

You are absolutely right, I think we should definitely clarify that paragraph and perhaps mention in a succint way what's the behavior for each group of commands. Maybe writing a note for each and every command will make the it too verbose, so we will have to think about how to redact it best. I'm glad you took the time to read the documentation carefully, thanks for spotting this :-)

from clac.

jasonmhite avatar jasonmhite commented on May 30, 2024

An easy and consistent solution would be to simply add the guard by count to the functions that don't have it right now, so that they also become no-ops. I mean something like changing

else if (!strcasecmp(word, "sum")) {
	push(s0, add(s0, count(s0)));
}

to

else if (!strcasecmp(word, "sum")) {
    if (count(s0) > 0) {
	push(s0, add(s0, count(s0)));
    }
}

This would change the behavior to make sum (and the others) a noop instead of default to zero, but it'd be consistent and that behavior seems intuitive to me. Not sure if that's what you want, but it's what I would suggest.

from clac.

Related Issues (17)

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.