@thuna_cing@emacs.ch avatar

thuna_cing

@thuna_cing@emacs.ch

This profile is from a federated server and may be incomplete. Browse more on the original instance.

zyd, to Lisp
@zyd@emacs.ch avatar

This is a very important question: which indentation do you prefer for loop subclauses, A or B.

Screenshot of Common Lisp code using the Loop macro. This one is identified as option B. Each conditional subclause (in this case

thuna_cing,
@thuna_cing@emacs.ch avatar

@zyd I guess I would prefer B (with if and else aligned) but I don't usually write complicated loop logic so the bigger deal for me is the indentation of lines which don't start with a loop keyword; any rule which has those indented is good in my eyes.

thuna_cing,
@thuna_cing@emacs.ch avatar

@zyd I agree that the loop is a much better choice than the alternatives in this scenario.

(Also, I am not fully sure what the order of execution of the for' and until' clauses are but the code in the image might be discarding the last row.)

thuna_cing,
@thuna_cing@emacs.ch avatar

@screwtape @zyd Sorry, I am not really following. What do you mean by "if you had multiple lines"?

thuna_cing,
@thuna_cing@emacs.ch avatar

@screwtape @zyd Well, kind of.

Yes, if you had an :else' followed by a :do' followed by some form, that form would be indented twice (with two spaces per indent).

The code in the image isn't indented properly though: :else' should be aligned with :if', the form after :do' should be indented by two spaces, and the second form after :do' is an error, though even if it wasn't it still wouldn't be a part of `:do' so it would be dedented.

thuna_cing,
@thuna_cing@emacs.ch avatar

@screwtape @zyd No, :when or :unless don't allow :else clauses so it's unambiguous in this case.

thuna_cing,
@thuna_cing@emacs.ch avatar

@screwtape @zyd It's broken on 30.0.50 as well, both the :else not being indented with :collect on its own line and it being too indented when :collect is immediately following the :if.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • tester
  • InstantRegret
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • lostlight
  • All magazines