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))"