ITT: post some damn beautiful code

ITT: post some damn beautiful code.

I'll start:
Common Lisp's dotimes macro, implemented w/ return in Scheme:
(define-syntax dotimes
(lambda (x)
(syntax-case x ()
((_ (var count) body ...)
(with-syntax ((return (datum->syntax x 'return)))
#'(call/cc (lambda (return)
((lambda (f)
(f 0 f))
(lambda (var f)
(if (< var count)
(begin body
...
(f (+ 1 var) f))))))))))))

(dotimes (i 4)
(if (or (= i 1) (even? i))
(begin (display i)
(newline))
(return 'arbitrary)))

Other urls found in this thread:

shaunlebron.github.io/parinfer/
twitter.com/NSFWRedditImage

>beautiful
>)))))))))))
Pick one. I love lisp, but parentheses suck. They should let you infer parentheses based on indentation.

I wish that lisp didn't use so many parenthesis, it keeps reminding me of that damn Sup Forums meme.

:3

cube_t *create_cube(unsigned x, unsigned y, unsigned z)
{
cube_t *ptr = malloc(sizeof(cube_t));
ptr->size.x = x;
ptr->size.y = y;
ptr->size.z = z;
unsigned i, j; /* make 3D cube */
ptr->cube = malloc(sizeof(unsigned char **) * x);
for (i = 0; i < x; i++)
ptr->cube[i] = malloc(sizeof(unsigned char *) * y);
for (i = 0; i < x; i++)
for (j = 0; j < y; j++)
ptr->cube[i][j] = malloc(sizeof(unsigned char) * z);
return ptr;
}

The Parenthesis are the source of power, user.

If it weren't parenthesis, it'd be something else. Racket lets you mix and match [] and {}.

Sieve of Eratosthenes in 5 lines, using functional nested for-comprehensions in Racket Lisp:
(define (erac n)
(for*/fold ([primes (range 2 (add1 n) 1)])
([candidate (range 2 (add1 n) 1)]
[composites (range (* 2 candidate) (add1 n) candidate)])
(remv composites primes)))

Which meme is that? I'm not aware of it.

Y'know, real cubes only need one value that'll stand for its width, height and depth at the same time.

Surrounding Jews' names with ((( ))), I think it was.

>They should let you infer parentheses based on indentation.
shaunlebron.github.io/parinfer/
Here you go dude, enjoy.

Sounds like a pretty dumb/unfunny meme, not gonna lie.

>using an array of arrays of arrays
>not just using some simple math and using a single array

Isn't pol meme originally
Literal Jews put it around their twitter names for some awareness jew shit

I believe it was born(or gave birth to) from an extension called "Coincidence?", that detected the names of Jewish people on important positions and surrounded it with parenthesis on webpages.

Google took it down and apparently the Jews started using it themselves for whatever reason.

It's some retarded way of reclaiming it like how queers and blacks have reclaimed slurs against them.

Yeah, Sup Forums started using it more when coincidence detector got taken down from chrome store. I just don't find this one funny, it's just used for shitposting. It's not like any other Sup Forums meme that has a sense of charm to it.

I don't like Jews so it works for me
>oy vey muh 6 gorillion

The irony is that the jews who use the ((())) as a form of mockery only makes identifying them easier. They're only setting themselves up.

>(((Rosenthal)))

Pardon? I don't think this Sup Forums meme is funny, I don't have to like every meme that Sup Forums likes.

How does it compare to paredit/smartparens? Being able to handle parens intelligently via indentation is cool, but sometimes there are specific operations I want to carry out which don't rely on indentation.

bumping for more lisp or otherwise beautiful code.

21st for the metacircular evaluator
https:/www.youtube.com/watch?v=0m6hoOelZH8

That's not the Sieve of Eratosthenes. If you went to a Lisp school, you didn't really learn how to program.

not meant to be funny

(((((You)))))

Beautiful =/= unreadable

Newton’s method root calculator in MoonScript

Y = (f) ->
(...) ->
(((x) -> x x) ((x) -> f ((y) -> (x x) y ))) ...

root = (n, x) ->
(Y (f) ->
(o) ->
new = ((n - 1) * o + x / o ^ (n - 1)) / n
(math.abs new - o) < 1e-6 and new or f new) n, x

print root 3, 10 -- 2.1544346900319

(=~~H:{27TSeR,sN/o-9J*ZFEhgUdc.~aO;tyxwZYnFEkSihgfONvhg9rHFE[Z}X{VU>x

Fuck off, it's better than your degenerate anime or that fat kike (((stallman))).

>Getting upset because someone didn't like your meme
Quit crying you sensitive homo.

You didn't like the meme because you're a kike.

That is just plain ugly

I'm a different person, but OK.
You edgy cucklord ((((jew)))) nigger SJW autist.
t. Captain Barbossa

Shlomo sure is #triggered

Sounds like you didn't like my memes.

Not when kikes like you use them, you're trying to infiltrate my website.

Fuck off, it's better than your degenerate anime or that fat goy ))))))stallman(((((((.

(((Stallman))) is a filthy communist kike you retard. Get the fuck off my website schlomo.

Am i on Sup Forums, Sup Forums or Sup Forums?

STOP THIS HYPOCRISY

You deny that you play games and claim they are only fir children, but you always have the latest GPU in the market and 75% of g is about them, you autism hoarding peasants!

And now in this thread Sup Forums has showed up...


Explain yourself!

Is this TECO?

Plankalkül

Fuck off you cancerous (((newfag)))

> Sup Forums damage control

Isn't summer great?

(andmap prime? (erac 1000))
=> #t
Sure looks like it bud.

Interesting, bump.

>(((anime))) loving degenerate calling anything that disagrees with him bait and summer and Sup Forums
pottery

Does Sup Forums also enjoy Lisp?