betaveros / noulith Goto Github PK
View Code? Open in Web Editor NEW*slaps roof of [programming language]* this bad boy can fit so much [syntax sugar] into it
*slaps roof of [programming language]* this bad boy can fit so much [syntax sugar] into it
from
with
An chaining operator like elixir's |>
but appends additional arguments i.e. a zip b <| c <| d
is a zip with b with c with d
is zip(a, b, c, d)
.
I think <|
will look nice when you want to provide an argument per line:
a zip b
<| c
<| d
;
When you inline function arguments with multi-line lambdas, any arguments following multi line lambda become unreadable. i.e. from start
in the following:
rng fold (\accum, el ->
(
# multi line
# lambda
)) from start;
So I think having fold1 :: [a] -> (a -> a -> a) -> a
and fold :: [a] -> a -> (a -> a -> a) -> a
is better alternative than an optional from
as you could write:
rng fold start <| (\accum, el ->
(
# multi line
# lambda
));
Good luck with this language
(not expecting support, feel free to skip — adding some issues as I come across them)
Generally I would expect:
X = foo bar;
print baz (X);
to be equivalent to
print (baz (foo bar));
...i.e. extracting something into a variable doesn't change the semantics1.
But here it doesn't seem to be. This works:
X := {"foo"}.keys;
print pop X;
But this doesn't:
print (pop ({"foo"}.keys));
PARSE ERROR: can't to_lvalue
print (pop ({"foo"}.keys));
(expr 22:13-22:20)
at first expr in call arg list (22:8)
at first expr in assign LHS (22:1)
Is my mental model wrong for what's going on? I didn't completely understand the error message either.
Thank you!
I realize that languages like rust occasionally don't honor this, since the assignment can avoid temporary values, but I'm guessing that's not the issue here...
_
for both lambdas and discards seems confusing. Have you considered some alternatives?Hi,
Just a note to point out that input files for Advent of Code are copyrighted.
https://www.reddit.com/r/adventofcode/wiki/faqs/copyright/inputs/
The rest of your documentation is quite complete. Here's a toy example
noulith> print! for(i <- 65 to 70) yield [i, chr(i)] into dict;
{67: "C", 66: "B", 69: "E", 65: "A", 68: "D", 70: "F"}
goodproject
That is all
I'm not sure whether you're here to answer questions — no worries at all if you're not.
Does this fail because indexing is lower precedence than a function call?
X := [1,2,3];
print X[0];
# ERROR: type error: Chain cannot use nonblock in operator position: [1, 2, 3]
# print X[0];
# at op 1/1 (14:7-8)
# at ;-sequence(2/4) (12:13-18:9)
But this seems to work:
X[0].print;
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.