Welcome to the CHICKEN Scheme pasting service

intersperse added by S-liao on Wed Feb 26 14:12:35 2025

(define intersperse
  (lambda (lst x)
    (let loop ((ns lst))
      (if (##core#inline "C_eqp" ns '())
          ns
          (let ((tail (cdr ns)))
            (if (##core#inline "C_eqp" tail '())
                ns
                (cons (##sys#slot ns 0) (cons x (loop tail))) ) ) ) ) ) )


remove (if (##core#inline "C_eqp" ns '())
          ns

like the below code
(let loop ((ns lst))
     (let ((tail (cdr ns)))
       (if (eq? tail '())
           ns
         (cons (##sys#slot ns 0) (cons x (loop tail))) ) )  )

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which module provides `process-wait'?
Visually impaired? Let me spell it for you (wav file) download WAV