Menu

Show posts

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

Messages - starseed

#1
Anything else we might add? / Re: a modification
August 27, 2006, 02:37:08 PM
Actually, all displayed behaviour has been by design ... maybe based on just being lazy ;-)



I'll have a look into your changes - and then it would be nice to integrate both html-help, and online quickhelp.



Regards,



Ingo ;-)
#2
newLISP newS /
August 22, 2006, 12:31:31 PM
Yes,



that's what I thought ... whatever I did wrong, newLISP shouldn't crash ;-)



Mind you, I'm already very proficient in bugging newlisp programs, _debugging_ is a skill I still have to develop.



Thank you!





Ingo
#3
newLISP newS / mystery string bug ...
August 21, 2006, 10:23:34 AM
I don't understand, what happens here ...



Me being lazy I want a fast way to load a file ni the console, so I created the following, which tries to load a file by:

- converting the given file-name to a string and appending .lsp

- just converting to a string


(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"


I understand, that it can't load tools.lsp.lsp,

but after that it should just try tools.lsp, which seems not to happen ...

and I don't at all understand, where the tools.lsp.lsp in the error message comes from ...



(verson 8.9.6 Mingw)



Ingo
#4
newLISP newS / BUG: Crash with replace-assoc
August 21, 2006, 10:16:11 AM
I found a crash


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)


The problem is related to the assoc replacement not being quoted.



Regards,



Ingo
#5
newLISP newS /
August 21, 2006, 10:12:37 AM
Thats something I'm just now thinking about ...



I like to have named elements in datasets. Do have a better idea than the following?


(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)




Thanks,



Ingo
#6
newLISP newS /
August 21, 2006, 08:02:09 AM
Quote from: "Lutz"Few would use non legal symbols to name a context/namespace,


That's exactly why I used it ;-) I wanted to be sure to not clash with anything else. But it's not a big deal, I can safely use legal symbols.


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.


I'm somewhat accustomed to using lightweight objects (1). So I tried to implement something, I felt at home with. I'm not yet familiar enough to do everything "the newLisp way", it seems ...



(1)Actually, Rebol is somewhat orthogonal to newLisp: Rebol programmes use objects to implement namespaces, whereas in newLisp you can nuse namespaces to implement objects.




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':



(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


Thank, that may come in handy at times



Ingo
#7
newLISP newS /
August 21, 2006, 12:27:34 AM
Thanks,



I just wasn't sure, wether it's a known problem.





Ingo
#8
newLISP newS / [BUG] save non valid symbols (context)
August 20, 2006, 02:21:47 PM
Hi Lutz,



I created some symbols using sym, with strings which are really far from being valid symbols.


(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))


With gensym creating symbols like:  _(-(_gensym_0.1_)-)_

And just for the fun of it, I tried to save this mess ...



This is what I found in the file:


(context '_(-(_gensym_0.1_)-)_)

(set (sym "_(-(_gensym_0.1_)-)_" _(-(_gensym_0.1_)-)_)
 (lambda () (my-list my-index)))


Of course, this won't load ...





Kind regards,



Ingo[/code]
#9
newLISP newS / Testing framework?
August 20, 2006, 01:23:28 PM
Hi All,



does anyone have a testuing framework for newLISP? I remember that I've seen some code posted with a test= function ...







Thank you,



Ingo
#10
newLISP newS /
August 18, 2006, 07:33:44 AM
Thank you,



that worked.



It was the first time I had problems like this ... funny.
#11
newLISP newS / bug: hardcoded path in newlisp-tk?
August 18, 2006, 02:14:24 AM
Hi Lutz,



When I start newlisp-tk (newlisp 8.9.5), I get the following error:



Error sourcing /freewrap/newlisp-tk.tcl: couldn't execute "C:Programmenewlispnewlisp": no such file or directory



Which is quite OK, because it really doesn't exist, newlisp is

installed in E:ToolsNewlisp
#12
newLISP newS /
August 18, 2006, 12:02:08 AM
Ahh, thank you.
#13
newLISP newS / [bug] lambda? scanning error ...
August 17, 2006, 08:37:23 AM
Hi Lutz,



I have defined the following func:


(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))


in a file called tools.lsp, now when I load this file, I get an error:


> (load "tools.lsp")

invalid lambda expression : [text]lambda
      (list? val) 'list
      (macro? val) 'macro
      (string? val) 'string
      (symbol? val) 'symbol
      (atom? val) 'atom))
#14
newLISP in the real world /
August 17, 2006, 07:11:38 AM
Yes, this bug has been corrected in 8.9.4
#15
newLISP newS /
August 17, 2006, 07:10:06 AM
Quote from: "Lutz"to Norman: yes, UUIDs are very handy in many situations, file-ids, session-ids and zillions of other stuff. I am trying to get more DCE stuff into place, perhaps the next is an LDAP module?


And my nice gensym can be replaced by
(sym (uuid))