szensk / wul Goto Github PK
View Code? Open in Web Editor NEWsome lispy language
License: Other
some lispy language
License: Other
(let me
(dict ('name' 'szensk' 'age' 26))
)
(print (at me 'age')); prints 26
(let them
(object (name 'arthur' age 21))
)
(print (at them age)); prints 21
dict
functionat
aka @
magic functiontable
magic functionset
magic functionSomehow the result is negative. I suspect implicitly converting to int in the * function.
; comment
(def inc (a) (if (empty? a) (then ()) (else (concat (+ (first a) 1) (inc (rem a))))))
(inc (1 2))
Stack overflow
(2 3)
"\""
should yield a string of "
.
'\''
should yield a string of '
.
Sometimes I have to apply a scalar function to a list, e.g. (+ (2 3 4))
. Two options: (+ (unpack (2 3 4))
or (reduce + (2 3 4))
. While reduce works in this case, it's less flexible in general.
Unpack takes a list and returns multiple syntax nodes. Macro would be the easiest way to do this.
..
...
as an identifier(first [0 5])
yields 0
.(rem [0 5])
yields [1 5]
.([4 0 by -2] (1 2 3 4 5))
should yield (5 3 1)
.([0] (1 2 3))
should yield 1
.::
method to invoke .NET methodsCurrently it starts in global scope, make it start in it's own local scope. And add a global function for getting/setting globals.
def without the definition
Arithmetic
Bit
Logical
List/String/Range
Other
Instead it should throw an invalid list exception.
Functions maintain their definition scope. Magic functions need their scope of execution (to define values within) and their scope of definition (to access up values).
Example
(def print-a
(let a 5
(@defn print-a () (print (eval a)))
)
)
(print-a) ; prints nil
(def a 7)
(print-a) ; prints 7
Expected
Should print 5. Behavior should parallel regular functions.
Function quote
prevents the evaluation of a syntax node. So (quote ()) returns a ListNode.
and
or
(and 2 1)
should return 1(and 1 nil)
should return nil(and nil 1)
should return nil(or nil 1)
should return 1(or 1 2)
should return 1Example
(defn add (a b c)
(+ a b) ; this adds the first two arguments
)
Expected
It should produce a list node.
Result
It produces nil.
Macro
8
) or syntax node (e.g. (quote 8)
).@defn
MagicFunction
@invoke
aka InvokeMagic
meta-methodA 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.