picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

led.min.l (498B)


      1 # 05feb05abu
      2 # (c) Software Lab. Alexander Burger
      3 
      4 # *Line
      5 
      6 # Line input editing
      7 (de mkChar (C)
      8    (prin C)
      9    (queue '*Line C) )
     10 
     11 # Enable line editing
     12 (de *Led
     13    (use C
     14       (until (member (setq C (key)) '("^J" "^M"))
     15          (case C
     16             (("^H" "^?")
     17                (when *Line
     18                   (prin "^H ^H")
     19                   (setq *Line (cdr (rot *Line))) ) )
     20             ("^I" (do 3 (mkChar " ")))
     21             (T (mkChar C)) ) ) )
     22    (prinl)
     23    (prog1 (pack *Line) (off *Line)) )