Arc Forumnew | comments | leaders | submitlogin
2 points by almkglor 6103 days ago | link | parent

Hmm, not getting anyone excited I suppose. ^^

Now suppose that I told everyone that using a scanner would allow us to use --warning-blatant-self-promotion-- my p-m: modifier system:

  (def get-word (s)
    (let (pre-word word build hd tl) nil
      (= build
         (fn (c)
           (if hd (do (= (cdr tl) (cons c nil)) (= tl (cdr tl)))
                  (do (= hd (cons c nil)) (= tl hd))))
         pre-word
         (p-m:fn
           ( (,@(whitec _) . ss) ) (pre-word ss)
           (ss) (word ss))
         word
         (p-m:fn
           ( (,(c (nonwhite c)) . ss) ) (do (build c) (word ss))
               (string hd)))
      (pre-word (scanner-for-string s))))
This is because p-m uses only 'car and 'cdr to decompose the input list ^^