Elektrine lite

← Feed

@mousebot@todon.nl

Post #2849150

2026-05-07 18:17 UTC

@pkw just to conclude my FP tutorial in public, how is returning nil or false not functional? can't i say if we have nothing, gimme nothing. does it have to do with mutability somehow?

Replies (1)

  • @pkw@snac.d34d.net 2026-05-07 20:05

    In an ideal sense when and unless only _do_ something in the positive path. Like imagine you are setting the result to a variable. In the normal "if" case you know that the result will be valid. But in the one-sided when/unless case you don't. In practice that usually means you are doing it for the side effect which is by def. not functional. Neither lang CL or scheme is strictly functional but scheme seems to be more functional in its vibe. That's maybe why unless/when are in the lang of CL but not in the lang of scheme.

    Open ##2849151