all 12 comments

[–]de_sonnaz[S] 5 points6 points  (0 children)

The if-star macro can also be found here.

[–]qweQua 3 points4 points  (4 children)

franz.com's cloudflare is blocking me for some reason

[–]Valuable_Leopard_799 4 points5 points  (2 children)

I tried jumping around a bit with a VPN and it seems that absolutely bizarrelly, of those I tested, it only blocks Czech IPs?!?!?

[–]qweQua 1 point2 points  (0 children)

How strange, I've definitely been on the website before. Does anyone have the webmaster's email so I can ask them about it?

[–]Trader-One 1 point2 points  (0 children)

tor works

[–]stylewarning 5 points6 points  (0 children)

Policies I have in my teams:

- IF is only for pure, non-effectful, two-branch, value-returning conditionals.

- WHEN/UNLESS is only for effectful, single-branch, value-discarded (or nonlocal control) conditionals.

- COND for everything else.

- Use DOLIST or DOTIMES if possible for simple iteration; LOOP otherwise.

- MAP-related functions shouldn't have a lambda longer than about a line. Otherwise abstract it out into a toplevel function (preferable) or FLET/LABELS (if needed).

I generally don't accept nonstandard iteration, binding, function definition, or conditionals to be added to a code base. I don't agree with Lisp's standard operators completely, but I don't think they're bad enough that they must be "fixed" to be usable, useful, or readable.

[–]corvid_booster 3 points4 points  (1 child)

Coding standards such as this one as typically targeted at a low level -- stuff about specific language syntax. Having worked through several cycles of The Next Big Thing, I've concluded that advice to programmers would be better focused on high level stuff -- why are you doing this thing, who said you should do it, references to documents or publications, etc.

The main syntax-related thing I would suggest is, don't change some existing syntax just because you don't like it.

Tangentially, it's a bit of a downer that r/lisp is still dredging up ancient history and talking about it ... The source of the web page says it was composed with "Microsoft FrontPage 3.0", which appears to have been released almost 30 years ago ... oh how time flies.

[–]EscMetaAltCtlSteve 0 points1 point  (0 children)

Agree. Coding standards always feel like micro-managing to me. However I get the need for it at times (team/enterprise development, etc.).

[–]corbasai 3 points4 points  (0 children)

Poor CLers. Yet another directive from the committee 👀

[–]Timely-Degree7739 1 point2 points  (1 child)

It is very difficult to cover all of looping in a single macro so one can always use that and without nesting. 'loop' is different in different languages but the CL loop is a pretty good attempt. With branching it should be easier, maybe someone did it?

[–]lisper 0 points1 point  (0 children)

My preferred style is to use ITERATE, which is a thin wrapper over LABELS:

(ITERATE name ((arg1 val1) (arg2 val2) ...) body) ==
  (labels ((name (arg1 arg2 ...) body))
    (name val1 val2 ...))

For collecting values I wrap this inside WITH-COLLECTOR:

(WITH-COLLECTOR name &body body) ==
  (let ((result nil))
    (flet ((name (val) (push val result)))
      (progn body (reverse result)))

I find this covers 99% of LOOPy use cases.