Skip to content

a few expansion ideas on use cases for demonstrated capabilities #570

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

Closed
wmannis opened this issue Mar 1, 2025 · 5 comments
Closed

a few expansion ideas on use cases for demonstrated capabilities #570

wmannis opened this issue Mar 1, 2025 · 5 comments

Comments

@wmannis
Copy link
Contributor

wmannis commented Mar 1, 2025

Now that I've made one pull request I've got the cookbook on my mind, and a few smaller items occur to me, but I wanted input first.

While the point of the cookbook is explicitly to avoid discussing the Deep Magic, there are a few sections where I think a little more guidance on why you might choose something could be helpful.

  1. What are the use cases for let over defun — encapsulation across a few functions to avoid globals, generators. Just demonstrating a lexical closure might not say enough.
  2. What are other uses cases for values? CL itself offers clues: round, truncate, etc.; distinguishing a failed lookup from a nil value.
  3. If you're doing a lot of setting and getting on structs, symbol-macrolet is probably your friend (which is what with-slots expands to for classes).

I assume it makes most sense to do each of these separately, do deal with feedback.

@vindarel
Copy link
Contributor

vindarel commented Mar 2, 2025

I've got the cookbook on my mind

yay

let over defun

you mean over defvar or defparameter? These are not explained, I still want to add a page about variables.

values

more examples welcome

symbol-macrolet

this isn't covered, so a section on it is welcome.

@wmannis
Copy link
Contributor Author

wmannis commented Mar 2, 2025

you mean over defvar or defparameter? These are not explained, I still want to add a page about variables.

Sorry, I mean closures:

(let ((n 0))
  (defun counter () (incf n)))

Most examples look a lot like that use case.

@vindarel
Copy link
Contributor

vindarel commented Mar 3, 2025

oh right. Closures are mentioned in the Functions chapter, but quickly, we end with "See more on PCL" :D

@wmannis wmannis closed this as completed Mar 20, 2025
@vindarel
Copy link
Contributor

vindarel commented Mar 20, 2025

Keep your eyes open and the markdown files open! realizes you used the GitHub editor

@wmannis
Copy link
Contributor Author

wmannis commented Mar 20, 2025

I would never edit code that way, but it's a convenient markdown preview.

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

No branches or pull requests

2 participants