• Re: Can someone please explain me what's wrong with this code ?

    From B. Pym@Nobody447095@here-nor-there.org to comp.lang.lisp,comp.lang.scheme on Thu Jul 3 13:29:11 2025
    From Newsgroup: comp.lang.scheme

    Ken Tilton wrote:

    (defun some-thing-pos (list test)
    (loop for e in list
    for pos upfrom 0
    for res = (funcall test e)
    when res return (list res e pos res))) ;; order to fit name

    I must say, however, I am suspicous of the whole business, and would
    like to see the calling code so we can really rake this bum over the coals.

    Gauche Scheme

    (use srfi-42) ;; first-ec

    (define (position things test)
    (first-ec #f
    (:list e (index i) things)
    (if (test e))
    (list i e)))

    (position '(oh sun is happen four)
    (lambda(s) (> (string-length (x->string s)) 4)))
    ===>
    (3 happen)
    --- Synchronet 3.22a-Linux NewsLink 1.2