Comment

Comment by brudgers

Right. If I have the Python code to parallel the Common Lisp:

  import time                                                        
                                                                   
  def drill(n, f):                                                   
      for i in range(0, n):                                          
          f(i)                                                       
          time.sleep(1)                                              
                                                                   
  def gen(n):                                                        
      print(n)                                                       
                                                                   
  drill(10, gen)
I get:

  $> python3 interrupt.py
  0
  1
  2
  3
  ^CTraceback (most recent call last):
    File "interrupt.py", line 11, in <module>
      drill(10, gen)
    File "interrupt.py", line 6, in drill
      time.sleep(1)
  KeyboardInterrupt
  $>
The funny thing is though I've known it was possible to redefine running Common Lisp code and I have seen the Continue option many times, it really wasn't clear why it would be used and in part because it is mostly ignored in descriptions of Common Lisp. I mean the behavior isn't described in the SBCL User Manual. Nor is it really fleshed out in the Common Lisp HyperSpec http://www.lispworks.com/documentation/HyperSpec/Body/f_abor...
parent brudgers 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton