647
functions (lemmy.ml)

cross-posted from: https://lemmy.ml/post/39334581

you are viewing a single comment's thread
view the rest of the comments
[-] save_the_humans@leminal.space 21 points 6 days ago

Anyone tried lisp? Looks something like this. ((()))()())))

[-] SlurpingPus@lemmy.world 18 points 6 days ago

Remarkable how if the parenthesis is shifted from lambda() to (lambda), people lose the ability to comprehend things.

[-] Jankatarch@lemmy.world 2 points 6 days ago* (last edited 6 days ago)

Isn't it more like
foo(){…} -> (define foo (lambda () …))
tbf?

[-] stammi@feddit.org 2 points 5 days ago

In clojure it's (def (fn [])) or short (defn []).

[-] SlurpingPus@lemmy.world 2 points 6 days ago* (last edited 6 days ago)

In Emacs Lisp, you use one of these two:

(defun funcname (arg1 arg2) (+ arg1 arg2))

(lambda (arg1 arg2) (+ arg1 arg2))

— with the latter typically being an argument to another function or macro.

[-] Jankatarch@lemmy.world 1 points 6 days ago* (last edited 6 days ago)

Your next task is to declare 3 unequal integer variables in scheme and then add them to a 4th letter. Finally tell if it's 0 or not.

C equivalent for reference.

// init
int foo = 1;
int goo = 2;
int bar = 3;
// compare
if(foo + goo + bar) //…
else //…
this post was submitted on 22 Nov 2025
647 points (98.6% liked)

Programmer Humor

27534 readers
255 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS