aoeuidhtns
(replying to Rue Mohr)
@saagar@federated.saagarjha.com @RueNahcMohr@infosec.exchange
`(mismatched bracket two characters after the s
hold on, you've nerd sniped me, i need to make a "mocking lisp for all its parentheses generator", in lisp
it'll be so easy :)
; yes, this is valid scheme code, if you define "in"
aoeuidhtns
(replying to aoeuidhtns)
@RueNahcMohr@infosec.exchange @saagar@federated.saagarjha.com
done?:
(use-modules (srfi srfi-1) (srfi srfi-27))
(define (add-parens lst)
(if (eq? (length lst) 1)
lst
(let ((rand (+ 1 (random-integer (- (length lst) 1)))))
(list (add-parens (take lst rand)) (add-parens (drop lst rand))))))
(add-parens '(l i s p)) ; => ((l) ((i) ((s) (p))))
aoeuidhtns
(replying to aoeuidhtns)
@RueNahcMohr@infosec.exchange @saagar@federated.saagarjha.com
i guess it only works in guile
aoeuidhtns
(replying to aoeuidhtns)
@RueNahcMohr@infosec.exchange @saagar@federated.saagarjha.com
i was trying to make it portable by using srfis instead of guile functions but i then used the guile module syntax foolishly thinking that it was standard
aoeuidhtns
(replying to aoeuidhtns)
@RueNahcMohr@infosec.exchange @saagar@federated.saagarjha.com
i guess importing srfis just isn't a thing you do (outside of guile and chicken scheme, as far as i am aware)
i think in chicken scheme or wherever srfi importing is practiced, you could replace the first line with "(import (srfi 1) (srfi 27))"