guicho271828 / trivia

Pattern Matcher Compatible with Optima
Other
332 stars 22 forks source link

API unification on multiple values #123

Open xificurC opened 3 years ago

xificurC commented 3 years ago

Would it be possible to implement a values pattern?

(match (values 1 2)
  ((values 1 b) b))

Then all the multiple-value-* macros wouldn't be needed. Additionally this would work:

(let-match1 (values 1 b) (values 1 2) b)
guicho271828 commented 3 years ago

I have written bunch of code myself using multiple-value-match, so removing this api is not a choice. Detecting multiple value is possible but requires a rewrite of the frontend (mainly match macros, no need to change level1 nor pattern expanders). Currently I do not have time for that.

xificurC commented 3 years ago

wouldn't be needed =/= removing the API, i.e. I didn't think of removing the already existing functions/macros, just enriching what match can do so future uses can be unified.

Currently I do not have time for that

I understand. Thanks for replying