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
Add `-defun' #347
base: master
Are you sure you want to change the base?
Add `-defun' #347
Commits on Nov 6, 2020
-
`-defun' is like `-lambda', but with destructuring. To implement it, abstract the arglist and form generation code of `-lambda' into separate functions. Additional benefits of the refactoring are: - `-lambda' (and by extension, `-defun') can now accept empty argument lists - `-lambda' (and `-defun') no longer rebinds symbols (fixing the TODO) Various declaration forms should be handled properly in `-defun'. Motivation: when this is merged, `lsp-defun' can be made an alias for `-defun'.
Configuration menu - View commit details
-
Copy full SHA for f3f29e3 - Browse repository at this point
Copy the full SHA f3f29e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6add372 - Browse repository at this point
Copy the full SHA 6add372View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a63e45 - Browse repository at this point
Copy the full SHA 3a63e45View commit details -
-defun',
-lambda': support &optional and &rest- Add a `-defun' &rest example. - `-defun': add (declare debug), making it debuggable
Configuration menu - View commit details
-
Copy full SHA for 727df5c - Browse repository at this point
Copy the full SHA 727df5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 379e48c - Browse repository at this point
Copy the full SHA 379e48cView commit details -
-lambda': support declare-forms; add
-defmacro'Refactor `dash--destructure-body' to handle declarations and docstrings itself, meaning that more code can be shared between `-lambda' and `-defun'. Refactor `dash--destructure-body' to add signatures to the docstring of BODY if necessary. This means that docstrings for `-defun' and `-lambda', ... now generate functions with proper signatures. Add `-defmacro', which is like `-defun' but as a macro.
Configuration menu - View commit details
-
Copy full SHA for 24850aa - Browse repository at this point
Copy the full SHA 24850aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e989aa - Browse repository at this point
Copy the full SHA 2e989aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03186e0 - Browse repository at this point
Copy the full SHA 03186e0View commit details -
For &as bindings, don't generate input<n> parameters but use the names in the corresponding functions directly. (-lambda ((sym &as &DocumentSymbol :detail?))) -> (lambda (sym) (-let ...))
Configuration menu - View commit details
-
Copy full SHA for 6a87bae - Browse repository at this point
Copy the full SHA 6a87baeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 95462fc - Browse repository at this point
Copy the full SHA 95462fcView commit details -
`-defun', ...: optimize &as bindings in vectors
&as bindings would generate paramters for lists already. Now do the same for destructured vectors, too.
Configuration menu - View commit details
-
Copy full SHA for c4ffe96 - Browse repository at this point
Copy the full SHA c4ffe96View commit details
Commits on Nov 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 6f2626f - Browse repository at this point
Copy the full SHA 6f2626fView commit details
Commits on Nov 13, 2020
-
For some reason, using `-let' in `dash--destructure-body' caused compile-errors when running the tests. Use `let*' + manual destructuring instead, fixing the error and making the test suite pass.
Configuration menu - View commit details
-
Copy full SHA for bcfd26a - Browse repository at this point
Copy the full SHA bcfd26aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd53121 - Browse repository at this point
Copy the full SHA fd53121View commit details
Commits on Nov 26, 2020
-
dash--destructure-body': optimize: use
-let*'`-let*' generates less bytecode than `-let', even if otherwise equivalent, because the latter is implemented in terms of the former, with many temporaries. This is exacerbated when using dynamic binding, because all of those variables also need to be bound dynamically. Add a TODO note because this is an implementation detail; `-let' needs to be optimized independently.
Configuration menu - View commit details
-
Copy full SHA for 92e623f - Browse repository at this point
Copy the full SHA 92e623fView commit details -
`dash--destructure-arglist': docstring generation
No longer generate a redundant nil in `-defun' and `-defmacro', if no docstring is provided and the arglist doesn't use destructuring. This was due to a bug in `dash--destructure-body' only triggered in that case with NODOC=nil.
Configuration menu - View commit details
-
Copy full SHA for 23749b3 - Browse repository at this point
Copy the full SHA 23749b3View commit details -
Fix edebug specs: debugging `-defun'
Use `def-body', as is used in `cl-defun', allowing `-defun' to be debugged.
Configuration menu - View commit details
-
Copy full SHA for 6afe446 - Browse repository at this point
Copy the full SHA 6afe446View commit details -
`-defun', ...: improve error handling
Before this PR, a `wrong-type-argument' error was issued if the match-form wasn't of appropriate type. Restore this behavior by `signal'ing this way again if the arglist is of incorrect type.
Configuration menu - View commit details
-
Copy full SHA for 376acdb - Browse repository at this point
Copy the full SHA 376acdbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 34d618b - Browse repository at this point
Copy the full SHA 34d618bView commit details
Commits on Dec 30, 2020
-
-lambda': don't interpret
declare'For `lambda', `declare' is ignored. Do the same in `-lambda', allowing a `-lambda' that starts with `declare' to be debugged. To implement this, extend `dash--decompose-defun-body' to take an optional DECLARE? parameter that determines whether `declare' is supported in addition to `interactive'. Note that macros can still be `interactive'. This is consistent with `cl-defmacro', which doesn't put the first `interactive' in `cl-block'.
Configuration menu - View commit details
-
Copy full SHA for 79a71d6 - Browse repository at this point
Copy the full SHA 79a71d6View commit details -
`dash-lamba-list': remove TODO
It would be a waste of time to implement a proper edebug spec for it, since `dash''s destructuring logic is very complex and extensible. In addition, this would make extending `dash''s destructuring logic harder.
Configuration menu - View commit details
-
Copy full SHA for 30a0de5 - Browse repository at this point
Copy the full SHA 30a0de5View commit details
Commits on Jan 6, 2021
-
-defun', ...: use
make-symbol'The input<n> temporaries used in the generated function's arglists are now uninterned symbols, preventing users of `-defun', `-lambda', ... from accessing them. To implement this, a new intermediate step was added: `dash--parse-arglist' extracts variable bindings from a given arglist, and `dash--destructure-arglist' (formerly `dash--make-arglist') and `dash--destructure-body' now also take the result of the first function. This needed because uninterned symbols need to be communicated to these functions. Additional benefits of the new intermediate step are that `dash--destructure-body' no longer needs to know anything about how the arglist looks like and that there is no part of `dash' needs to know anything about `lambda', `defun', ... keywords.
Configuration menu - View commit details
-
Copy full SHA for e0fb5d5 - Browse repository at this point
Copy the full SHA e0fb5d5View commit details -
`dash--as-matcher?': destructure directly
As of the previous commit, `dash--matcher?' only has one user, `dash--parse-arglist'. Refactor the former to now also do destructuring, yielding a better API and reducing code, as `dash--as-matcher-variable' and `dash--as-matcher-tail' could be eliminated.
Configuration menu - View commit details
-
Copy full SHA for 2f9fc8c - Browse repository at this point
Copy the full SHA 2f9fc8cView commit details -
`dash--as-matcher?': [x &as] is not an as-matcher
`-let' treats [x &as] as destructuring a vector of two elements, `x' and `&as', while `dash--as-matcher?' would treat it as x being destructured like the empty vector. Fix that by constraining vector matchers to be of at least length 3.
Configuration menu - View commit details
-
Copy full SHA for 148a833 - Browse repository at this point
Copy the full SHA 148a833View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83a3c12 - Browse repository at this point
Copy the full SHA 83a3c12View commit details
Commits on Jan 7, 2021
-
`dash--destructure-body': DOC -> ARGLIST
As of shared arglist parsing refactoring, ARGLIST was only used to compute the docstring. Remove DOC, and make ARGLIST in its place imply that a docstring is to be generated.
Configuration menu - View commit details
-
Copy full SHA for bcc9763 - Browse repository at this point
Copy the full SHA bcc9763View commit details -
`dash--decompose-defun-body': drop DECLARE?
(command-execute (lambda () (declare) (interactive))) works, so all declarations must be parsed. This function now behaves similar to `macroexp-parse-body', except that the last form is not treated as the body, so that (-lambda () (interactive)) works.
Configuration menu - View commit details
-
Copy full SHA for caf7445 - Browse repository at this point
Copy the full SHA caf7445View commit details -
`-defun', .... reduce code duplication
Abstract the common parts of `-defun', `-lambda', etc. into the new function, `dash--defun'.
Configuration menu - View commit details
-
Copy full SHA for 7895a2b - Browse repository at this point
Copy the full SHA 7895a2bView commit details -
Drop `dash--docstring-add-signature'
`help-add-fundoc-usage', from the pre-loaded `help' library, is more robust (it properly handles quotes), so use that.
Configuration menu - View commit details
-
Copy full SHA for 9ac1487 - Browse repository at this point
Copy the full SHA 9ac1487View commit details
Commits on Mar 22, 2021
-
dash--decompose-defun-body': behave like
defun'If a `defun' contains only a single string in the body, that string is considered both result and docstring. Do the same for `-defun'. This patch also makes that function parse a `-defun' whose body consists only of strings correctly. Add regression tests.
Configuration menu - View commit details
-
Copy full SHA for d8cab22 - Browse repository at this point
Copy the full SHA d8cab22View commit details -
`dash--normalize-arglist' should wrap them in another list. Add a regression test.
Configuration menu - View commit details
-
Copy full SHA for 8ac91de - Browse repository at this point
Copy the full SHA 8ac91deView commit details -
Only 3 examples are shown in the manual, so move the various cons adding examples later since they are not helpful. As such, show an `interactive' example, a Docstring result example and a square bracket args example. Rename `example/add-cons' -> `example/interactive'.
Configuration menu - View commit details
-
Copy full SHA for 66f513e - Browse repository at this point
Copy the full SHA 66f513eView commit details