Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    (defun for-duration (seconds body)
        (handler-case  
             (bt:with-timeout seconds 
        	   (body))
           (bt:timeout () nil)))
    
    (for-duration 10
        (lambda ()
          (loop 
            (print "Infinite loop! where is your Godel now?"))))


I think Greg is trying to say "why the hell do we even need macros for this"?


With functions you have to make a conscious effort to quote arguments, otherwise the strict evaluation will evaluate its arguments before the function. Also, with macros you can introduce you new "implicit" control and structure semantics; it's very common for forms to have an "implicit progn", or a block named NIL or similar.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: