select "segmentation fault"

Started by newdep, November 01, 2006, 03:22:05 AM

Previous topic - Next topic

newdep

Hi Lutz,



Should this happen?

Perhpas its just a little too nested?





newLISP v.9.0 on Linux, execute 'newlisp -h' for more info.



> (select D (index true? (map directory? (setq D (directory)))))

Segmentation fault





Norman.
-- (define? (Cornflakes))

newdep

#1
just an addon...



The above was on my path by creating the smalest directory selection from a bunch of files.. So if the above doesn't work then i guess this is

the smallest a "directory filter" can get in newlisp ->



(and (setq X (index true? (map directory? (setq D (directory))))) (select D X))



Norman.
-- (define? (Cornflakes))

Lutz

#2
The first definition crashes because D is modified by 'setq' while beeing used by 'select'.



Also using 'select' with an index list constructed using 'index' is the same as using 'filter', so why not just doing?


(filter directory? (directory))

or if you want all files not a directory:


(clean directory? (directory))

Lutz

newdep

#3
yes right I was a little overclocking the function ;-)



But 'clean? actualy how long does that one exist already? I never

seen it befor ;-) Great way to wake up again ;-)



Norman.
-- (define? (Cornflakes))

lisp

#4
It was put in @ v.8.8.7 according to the http://newlisp.org/downloads/old/newLISP_89_Release_Notes.html">8.9 release notes.

newdep

#5
Aaa im always running behind the mind expantion of Lutz...
-- (define? (Cornflakes))