toumorokoshi / disp Goto Github PK
View Code? Open in Web Editor NEWA lisp-based programming language, focusing on performance and powerful expressions
A lisp-based programming language, focusing on performance and powerful expressions
Right now, there's a syntactical purity to the declaration of functions. one can do:
let foo (fn [arg] [
(print "foo")
(print arg)
])
Effectively defining an anonymous function, then assigning it to foo. However, this syntax is a little cumbersome, because it requires the use of the bracket / parens in the function body.
A better looking function declaration could look like:
fn foo [args]
print "foo"
print arg
This looks a lot more like a declaration in Python: easy to read. However, this introduces a secondary way to declare such a function, which might make it harder for automated refactoring tools to detect and fix.
The automated refactoring might be a moot point anyway, because macros are effectively a re-expression of syntax and automated tools need to deal with that somehow.
Another alternative is to add a indentation rule that allows for a nested call to still use the no-expression rule. Something like:
let foo fn [args]
print "foo"
print arg
This currently won't work because one cannot disambiguate between what is an argument to the fn function, vs the let declaration of the foo. I'm not a fan of introducing that, as it then requires the reader to know how many arguments an expression takes to understand what the above statement is doing (I have to know "let" takes three arguments to know that the final indented list is consumed by the fn declaration instead.
Does anyone have thoughts on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.