benhj / arrow Goto Github PK
View Code? Open in Web Editor NEWAn interpreted programming language
License: MIT License
An interpreted programming language
License: MIT License
E.g.:
;;; should evaluate to true
wildcard_eq("hello.txt", "*.txt") -> res;
Wondering about networking builtins, e.g.:
http_read("http://server/path/something.dat") -> bytes;
Running ./arrow ../examples/macroLike.ar
prints Error: Unable to parse statement on line number 2
.
Expected result: running ./arrow ../examples/macroLike.ar
should print 3
running ./arrow ../examples/gen2.ar
prints Segmentation fault (core dumped)
If we have
"value" -> map:"someKey";
;;; should evaluate to true
;;; Note res, could be a pod where the first member is a boolean
;;; and the second is the actual key, e.g.:
map_contains(map, "*Key") -> res; ;;; should match
;;; retrieve if contains:
if(res:truth) {
res:key -> theKey;
}
Running ./arrow ../examples/argtest.ar hello
prints Error: Parse error
Running ./arrow ../examples/argtest.ar 123
prints 123
I would expect ./arrow ../examples/argtest.ar hello
to print hello
A non defined type should have nil.
E.g. get type of x and put result into res:
type(x) -> res;
If x is undefined, res could be nil
E.g:
"hello" -> $map:"key";
A 'Plain Old Data' type will likely have syntax similar to
pod data(a, b, c, d, e);
;;; invoked as
start {
;;; create a pod named data
data(1,2,3,4,5) -> f;
;;; access individual members of data
f:a -> var1;
f:b -> var2;
}
Running the factorial script using the old argument syntax causes a segmentation fault.
run: ./arrow factorial.ar 5
where factorial.ar
is:
fn factorial(n) -> f {
1 -> f;
if (n > 1) {
n * factorial(n - 1) -> f;
}
}
start {
arg 0 -> N; ;;; note the use of `arg 0` instead of `arg(0)`
pr "result: "; prn factorial(N);
}
Expected result: Parse error
Actual result: Segmentation fault
Currently, Environment::getProgramArgument
does an unchecked vector indexing m_programArguments[index]
, and ArgExpressionEvaluator::evaluate
relies on that unchecked throwing an exception. This is not always the case.
Replacing it with a checked indexing m_programArguments.at(index)
would fix this issue.
Line 114 in a8eb8f2
Line 110 in a8eb8f2
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.