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

Implement defun #6

Open
tshemsedinov opened this issue Dec 3, 2024 · 1 comment
Open

Implement defun #6

tshemsedinov opened this issue Dec 3, 2024 · 1 comment
Assignees
Labels
patterns-24 Patterns 2024

Comments

@tshemsedinov
Copy link
Member

Function declaration: (defun square (x) (* x x))

@tshemsedinov tshemsedinov added the patterns-24 Patterns 2024 label Dec 3, 2024
@zpwebbear
Copy link
Contributor

@tshemsedinov I just want to point out that it might not be as easy as it seems because of the following functions features:

  • documentation string (defun square (x) "Multiplying a number by itself." (* x x))
  • optional parameters (defun foo (a b &optional c d) (list a b c d))
  • rest parameters (defun format (stream string &rest values) ...)
  • keyword parameters (defun foo (&key a b c) (list a b c))
  • mixing different parameter types (defun foo (x &optional y &key z) (list x y z))

I'm also in doubts about to include lambda functions in this issue or not to include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patterns-24 Patterns 2024
Projects
None yet
Development

No branches or pull requests

2 participants