vindarel / cl-str

Modern, simple and consistent Common Lisp string manipulation library.
https://vindarel.github.io/cl-str/
MIT License
305 stars 37 forks source link

Make the body of each STRING-CASE case an implicit PROGN #103

Closed miklos1 closed 1 year ago

miklos1 commented 1 year ago

STRING-CASE silently drops additional forms in cases. This PR makes the body an implicit PROGN.

kilianmh commented 1 year ago

Hey @miklos1, thank you for your first pull request!

STRING-CASE silently drops additional forms in cases.

Indeed, you are correct:

To give an example:

(macroexpand '(str:string-case "str" ("str" 0 1 2) ("trs" 3)))

currently results in:

(LET ((#:G355 "str"))
  (COND ((STRING= #:G355 "str") 0) ((STRING= #:G355 "trs") 3)))

with your pull request:

(LET ((#:G355 "str"))
  (COND ((STRING= #:G355 "str") 0 1 2) ((STRING= #:G355 "trs") 3)))
vindarel commented 1 year ago

Thank you!