doc::man & doc::look added to stdlib

This commit is contained in:
VaclavT 2022-01-25 00:53:17 +01:00
parent 16b108d310
commit 383338ba27
2 changed files with 11 additions and 8 deletions

View File

@ -23,7 +23,7 @@
(define lines (map (lambda (ln) (parse-line ln)) lines)) (define lines (map (lambda (ln) (parse-line ln)) lines))
(define lines (filter (lambda (e) (!= e nil)) lines)) (define lines (filter (lambda (e) (!= e nil)) lines))
(set! doc::doc_entries lines) (set! doc::doc_entries lines)
"doc loaded" 'loaded
)) ))
(defun doc::print (entry) (defun doc::print (entry)
@ -51,7 +51,7 @@
) )
)) ))
(defun doc::lookup (what) (defun doc::look (what)
(do (define what_list (string-split (string-downcase what) "\s+")) (do (define what_list (string-split (string-downcase what) "\s+"))
(define scores '()) ; ((score entry)..) (define scores '()) ; ((score entry)..)
@ -84,10 +84,10 @@
)) ))
(defun doc::appropos (which) (defun doc::appropos (which)
(doc::lookup which)) (doc::look which))
(defun doc::section (which) ;(defun doc::section (which)
(print (term-red "implement me!"))) ; (print (term-red "implement me!")))
(define doc::doc_entries '()) ; must be here (define doc::doc_entries '()) ; must be here
@ -96,5 +96,5 @@
;;example ;;example
; (doc::man "first") ; (doc::man "first")
; (doc::lookup "string pad") ; (doc::look "string pad")
; (doc::lookup "list flat") ; (doc::look "list flat")

View File

@ -252,3 +252,6 @@
maxx maxx
) )
)) ))
; load and init do system
(include "/usr/local/var/mlisp/doc.lsp")