Comments (2)
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.
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)
- Great Code HOT 4
- Ubuntu has issues with the placement of the -lm flag HOT 1
- postfix after number should work and not be "ignored" HOT 3
- Add a tag or create release HOT 16
- Stack operator to roll top three values HOT 4
- Suggestion: Sci-Calc HOT 10
- Current stable version? HOT 1
- Suggestion: Factorial function HOT 4
- 0.3.2 build failure on macOS HOT 1
- It's even better HOT 1
- Suggestion: rename to clsc HOT 1
- Add more functions in `math.h` HOT 8
- Segmentation fault for circular definition in words HOT 2
- Suggestion: Comments in words file HOT 9
- Suggestion: reduce need for spaces HOT 1
- I can't find a way to (exit) out of the calc once I enterd the interactive mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clac.