Comments (5)
Looks good, but where would you define the arguments for tgis function? Or is it: no statement, no arguments? In that case, how do we separate (arguments) and (body) if they both use ()'s?
Sent via Hubroid
from -g-pl.
Nevermind that, I just saw that the draft says function{}(). I'm used to it being the other way around, I like it.
Sent via Hubroid
from -g-pl.
I have not worked lists into the spec yet but once they're in, it will be something like
>implying OP isn't >function{args} (
>mfw >len args
>mfw args[0]
)
Of course, if you can find a way to make this more /g/ related, I'm open to suggestions.
from -g-pl.
The reasoning why I swapped them, {} and (), is because the () is not just used for functions. () is used for all blocks and can be omitted if not needed.
For example, a function which only performs a single statement could look like:
>implying foo isn't >function{x} >mfw x
That being said, one potentially confusing thing could be the fact that () denotes blocks (which are statements), but statements are not expressions, so an unfamiliar user could accidentally try something like >mul 3 (>add 2 5) which is of course illegal. We could also swap them, as this would probably get rid of this ambiguity (and free up parentheses for other tasks, eg. grouping math if we're going to add infix operators)
If we swapped them, functions would look a bit more familiar:
>implying OP isn't >function(args) {
>mfw args[0]
}
I'll leave this up for debate.
Ps. I added you to the contributors list so you can push commits to this repository directly.
from -g-pl.
I've swapped them around for now, since it probably does make more sense this way.
from -g-pl.
Related Issues (17)
- Multiline comments HOT 2
- Allow global execution or not? HOT 10
- Repetition HOT 16
- gb2 needs a rework HOT 5
- Function call delimiter HOT 8
- Recursion HOT 1
- Thread on /g/ HOT 4
- Partial application HOT 1
- Easier conditional? HOT 3
- Array structure HOT 9
- Switch statement HOT 1
- Parsing diagram HOT 3
- "100% accurate" form for functions HOT 1
- Boolean HOT 3
- Finite State Machine and Lexer HOT 6
- Infix Operators vs Functions HOT 7
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 -g-pl.