Arc Forumnew | comments | leaders | submitlogin
2 points by aw 5206 days ago | link | parent

Very cool. Thank you for this.

What is the difference between minimal and minimum in this context?

One of the things I like about Lisp is that it makes it easy (or at least easier) to write code transformation facilities like this.

I can imagine other code contraction facilities might be possible, giving suggestions of what might be options, even if they weren't correct all the time. I often notice a pattern in my code that I start to write a function or macro to extract, and then discover that it is already available in arc.arc.



1 point by fallintothis 5205 days ago | link

What is the difference between minimal and minimum in this context?

I basically wanted to preempt complaints about

  arc> (sscontract '(no (no (no (f x)))))
  (~no:~f x) ; equivalent to (~f x)
because I didn't bother finding a clean way to compress it. Quasiquotes are a better example. Even though something like

  (mac even (x) `(no (odd ,x)))
would be fine to define as

  (mac even (x) `(~odd ,x))
sscontract is better-safe-than-sorry:

  arc> (sscontract '(mac even (x) `(no (odd ,x))))
  (mac even (x) (quasiquote (no (odd (unquote x)))))
Note that this specific behavior can be changed; see special-cases.arc.

I can imagine other code contraction facilities might be possible

Good guess: that's my next project. ;)

-----