You might like
Rebuild an index tree (e.g. after a model change): : (load "@lib/too.l") -> loadDB : (rebuild (db: +Item) 'nm '+Item) -> T #PicoLisp #lisp #REPL
Database check is faster if you allocate more heap space with 'gc' first: : (load "@lib/too.l") -> loadDB : (gc 1200) (dbCheck) ... #PicoLisp #lisp #REPL
A simpler way (if no other alarm is currently scheduled by the application): : (alarm (- (time 12 30) (time)) (kill *PPid)) -> 0 $ #PicoLisp #lisp #REPL
Stop current server process family (parent and all child processes) at 12:30 o'clock: : (wait (* 1000 (- (time 12 30) (time)))) (kill *PPid) -> T $ #PicoLisp #lisp #REPL
Digit sum: : (sum format (chop 9045)) -> 18 : (sum format (chop 123456789123456789123456789123456789)) -> 180 #PicoLisp #lisp #REPL
Non-recursive factorial: : (apply * (range 1 6)) -> 720 : (apply * (range 1 40)) -> 815915283247897734345611269596115894272000000000 #PicoLisp #lisp #REPL
Minimal HTTP-Server: (allowed () "!foo") (load "@lib/http.l" "@lib/xhtml.l") (de foo () (html 0 "Title" NIL NIL (<h1> NIL "OK") ) ) (server 8080 "!foo") #PicoLisp #lisp #REPL
Communicate with a separate PicoLisp process using plain text: : (pipe (exec "pil" "-while (read) (println (mapcar inc @)) (flush)")) -> 3 : (out 3 (println (1 2 3))) -> (1 2 3) : (in 3 (read)) -> (2 3 4) : (close 3) -> 3 #PicoLisp #lisp #REPL
Communicate with a separate PicoLisp process: : (pipe (exec "pil" "-while (rd) (pr (mapcar inc @)) (flush)")) -> 3 : (out 3 (pr (1 2 3))) -> (1 2 3) : (in 3 (rd)) -> (2 3 4) : (close 3) -> 3 #PicoLisp #lisp #REPL
Communicate with a child process: : (pipe (while (rd) (pr (mapcar inc @)) (flush))) -> 3 : (out 3 (pr (1 2 3))) -> (1 2 3) : (in 3 (rd)) -> (2 3 4) : (close 3) -> 3 #PicoLisp #lisp #REPL
Load (read+eval) directly from a tarball: : cos -> NIL : (load '("tar" "xfzO" "pil21.tgz" "pil21/lib/math.l")) -> atan2 : cos -> ((A) (set "Dbl1" A) (%@ "cos" 100 "Dbl1")) : (pp 'cos) (de cos (A) (set "Dbl1" A) (%@ "cos" 100 "Dbl1") ) -> cos #PicoLisp #lisp #REPL
List all IP addresses of this machine: : (make (in '(ip addr) (while (from " inet ") (link (till " " T)) ) ) ) -> ("127.0.0.1/8" "176.221.46.93/24") #PicoLisp #lisp #REPL
Elevation in meters above sea level: (de elevation (City) (ssl "en.wikipedia.org" (pack "wiki/" City) (and (from "Elevation") (from "infobox-data\">") (till "&" T)) ) ) : (elevation "Berlin") -> "34" : (elevation "Lhasa") -> "3,656" #PicoLisp #lisp #REPL
Write 16 random bytes and pipe into hexdump: : (pipe (do 16 (wr (rand 0 255)) ) (hd (fd)) ) 00000000 00 2D CF 46 29 04 B4 78 D8 68 A7 FF 3F 2B F1 FC .-.F)..x.h..?+.. -> NIL #PicoLisp #lisp #REPL
Deeper explanation of Vip ASCII drawing (video from 2019): picolisp.com/pub/VipAsciiDi… #PicoLisp #lisp #REPL
United States Trends
- 1. CarPlay 2,995 posts
- 2. Cynthia 95.8K posts
- 3. Osimhen 41.3K posts
- 4. Katie Couric 6,094 posts
- 5. #WorldKindnessDay 14.5K posts
- 6. Black Mirror 3,968 posts
- 7. Megyn Kelly 15.1K posts
- 8. Gabon 99.2K posts
- 9. Massie 95.6K posts
- 10. #LoveDesignEP7 181K posts
- 11. RIN AOKBAB BEGIN AGAIN 180K posts
- 12. Sheel N/A
- 13. Senator Fetterman 5,722 posts
- 14. Woody Johnson N/A
- 15. #NGAGAB 11.8K posts
- 16. Bonhoeffer 3,215 posts
- 17. #DirtyDonald 3,835 posts
- 18. Pat Bev N/A
- 19. Vine 14.6K posts
- 20. Seidler N/A
Something went wrong.
Something went wrong.