I'll have a look into your changes - and then it would be nice to integrate both html-help, and online quickhelp.
Regards,
Ingo ;-)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
(define-macro (do myfile)
"tries to load the file given as a symbol, tries to append .lsp"
(println myfile)
(or
(catch (load (println (string myfile ".lsp"))))
(catch (load (string myfile)))
(throw-error (string "file not found: " myfile))))
> (do tools.lsp)
tools.lsp
tools.lsp.lsp
problem accessing file : "tools.lsp.lsp"
newLISP v.8.9.6 on Win32 MinGW.
> (set 'test '((name "ingo")(last "Hohmann")))
((name "ingo") (last "Hohmann"))
> (push '(name1 "Whalesong") test)
(name1 "Whalesong")
> (replace-assoc 'name1 test (name1 "Starseed"))
invalid function in function replace-assoc : (name1 "Starseed")
(CRASHES)
(set 'persons '( ((name "Ingo") (last "Hohmann") (birth-place {Planet Earth})) ((name "ET") (birth-place "Sirius III"))))
(filter (lambda (v) (= "Ingo" (lookup 'name v 1))) persons)
Few would use non legal symbols to name a context/namespace,Quote from: "Lutz"
but illegal symbols may occur in dictionaries from life non-program texts and then the contsruction (sym "....." aContext) is useful. There are no plans to allow this for the symbols naming contexts.Quote from: "Lutz"
But here is another trick (undocumented) , which may be useful in your case. Put [ and ] as the first and last character of your symbols name. When the newLISP scanner finds a [ it will eat any other character until a closing ] and it can work as a symbol. The following snipped was generated on the keyboard saved with 'save' and reloaded with 'load':Quote from: "Lutz"
(context '[&9*^(& ()$&^%])
(set (sym "[jh((g90990&]" [&9*^(& ()$&^%]) 999)
(context 'MAIN)
In the 'set' statement you see that the context name works as a symbol, although it contains illegal characters.
Lutz
(context 'block)
(set 'my-list nil)
(set 'my-index nil)
(define (block:block)
(my-list my-index))
(define (block:new alist)
(let ((new-block (MAIN:new MAIN:block (gensym 'MAIN))))
(new-block:init alist)
new-block))
(set 'a (block:new))
(context '_(-(_gensym_0.1_)-)_)
(set (sym "_(-(_gensym_0.1_)-)_" _(-(_gensym_0.1_)-)_)
(lambda () (my-list my-index)))
(define (type val)
(if
(float? val) 'float
(integer? val) 'integer
(lambda? val) 'lambda
(list? val) 'list
(macro? val) 'macro
(string? val) 'string
(symbol? val) 'symbol
(atom? val) 'atom))
> (load "tools.lsp")
invalid lambda expression : [text]lambda
(list? val) 'list
(macro? val) 'macro
(string? val) 'string
(symbol? val) 'symbol
(atom? val) 'atom))