Skip to content

Instantly share code, notes, and snippets.

@wavebeem
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wavebeem/2db6be0cad464f17f37e to your computer and use it in GitHub Desktop.
Save wavebeem/2db6be0cad464f17f37e to your computer and use it in GitHub Desktop.
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