Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor make-screen-heads #344

Merged
merged 1 commit into from Apr 4, 2017
Merged

Refactor make-screen-heads #344

merged 1 commit into from Apr 4, 2017

Conversation

PuercoPop
Copy link
Member

This is just a refactor or the current head implemenatation to make it more readable. It is a first stop towards #328, which seems to have gone cold

@jorams jorams merged commit ed90a83 into master Apr 4, 2017
(setf (head-number head)
(incf head-index))))
(mapc #'set-head-number heads))))

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(loop for head in heads
      for i upfrom 0
      do (setf (head-number head) i))

Copy link
Member Author

@PuercoPop PuercoPop Apr 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Harleqin Yes, that is the code being replaced with a mapc, because it has a higher information density. Ideally I'd use misc-extensions's rflet so the flet would be at the end instead of cluttering the relevant code. Do you think the loop version is more readable in this case?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, absolutely, it also feels more declarative to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Harleqin I'm on the fence on this own. @jorams @dbjergaard Any preference?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly the flet+incf+mapc seems like scratching your nose behind your head to keep it functional. The operation is inherently declarative and its easier to mentally parse the loop version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K, I'll go back to using loop

@PuercoPop PuercoPop deleted the xrandr-screen-heads branch May 20, 2017 23:24
erjoalgo pushed a commit to erjoalgo/stumpwm that referenced this pull request Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants