Skip to content

Instantly share code, notes, and snippets.

@wavebeem
Last active Aug 29, 2015
Embed
What would you like to do?
Squiggle syntax brainstorm
let (
http = require("http"),
handler = fn(_req, res) do {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello, world!");
}
) do {
http.createServer(handler).listen(1337, "127.0.0.1");
print("Server started at http://127.0.0.1:1337/");
if (P) do {
A;
B;
C;
} else do {
D;
E;
F;
};
console.log(if (DEBUG) then "debug" else "production");
xs
.map(fn(x) x + 1)
.reduce(fn(acc, x) acc + x)
.forEach(fn(x, _, _) print(x));
finalValue;
}
let (
http = require("http"),
handler = ~( _req, res |
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello, world!")
)
) in
http.createServer(handler).listen(1337, "127.0.0.1");
print("Server started at http://127.0.0.1:1337/");
(if P then
A;
B;
C
else
D;
E;
F
);
console.log(if DEBUG then "debug" else "production");
xs
.map(~( x | x + 1 ))
.reduce(~( acc, x | acc + x ))
.forEach(~( x, _, _ | print(x)));
finalValue
let
http = require("http"),
handler = fn(_req, res) do
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello, world!")
end
in
http.createServer(handler).listen(1337, "127.0.0.1");
print("Server started at http://127.0.0.1:1337/");
if P then
A;
B;
C
else
D;
E;
F
end;
console.log(if DEBUG then "debug" else "production" end);
xs
.map(fn(x) x + 1)
.reduce(fn(acc, x) x + 1)
.forEach(fn(x, _, _) print(x));
finalValue
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment