[Tool] Nlist - remote content/code-browsing -

Started by newdep, December 01, 2007, 07:50:56 AM

Previous topic - Next topic

Cyril

#45
I have done a little hacking with nlist, trying to fix some most annoying issues (mad adventure while not understanding nlist internal logic and not even knowing GS API). My modifications:



* Existence of ./nlist/ is tested with directory? instead of file?



* First directory in history is loaded from root, not hardcoded



* text/html vs text/plain logic is fixed by brute force



* Last but not least, interface is redesigned. Decent web browsers users habitually expect green left and right arrows at the west of address bar to be history navigation, and a pair of twisted arrows at the east of address bar to be a reload button. Default nlist design does it upside-down and backwards, so I have fixed this. But don't fear](set 'cs-mode true)[/color] to nlist.cfg (it cannot be set from normal interface). I hope this will be useful...



Oh, I forgot: http://wagner.pp.ru/~slobin/newlisp/">//http://wagner.pp.ru/~slobin/newlisp/ using nlist
With newLISP you can grow your lists from the right side!

newdep

#46
Hello Cyril,



Good to see you hacked your way into nlist..

I was already working on a "plugin" option for nlist.

(thats why the Tabs are now there).. Im on my way

of releasing v0.50 but im a little bussy..meanwhile enjoy the tool ;-)



Norman.
-- (define? (Cornflakes))

Dmi

#47
Hi, Norman!



Just have browsing using your nlist. Nice work!



Is there a nlist.idx autogenerator (from the contents of lsp-files)?



Some ideas (I know all we have a lot of them ;-)



- Having a list of all nlist-supporting sites we can have a search engine.



- Probably, you can extend the idea directly to the scripting area:

Recently I have playing with such code:
; usage for directly load:
; (module:load-store "http://en.feautec.pp.ru/store/libs/funlib.lsp"
;                    "http://en.feautec.pp.ru/store/libs/xmlstream.lsp"
;                    .....)
;
; usage for once time loading - one file may be requested from many modules
:  and it will be loaded only once:
; (module:depend "http://en.feautec.pp.ru/store/libs/funlib.lsp")
;
(context 'module)

; configuration of cache path relative to HOME
(set 'libpath "newlisp/cache")

; prepare the local cache
(define (prepare-space)
  (set 'libdir (env "HOME"))
  (dolist (l (parse libpath "/"))
    (write-buffer libdir (string "/" l))
    (unless (directory? libdir)
      (begin
        (print "creating local folder: " libdir "...")
        (if (make-dir libdir) (println "done.")
          (begin
            (println "error.")
            (throw-error (string "cant't create: " libdir))))))))

; if module doesn't exists in the local cache, then download it
; finally, load module from the local cache
(define (load-store)
  (prepare-space)
  (doargs (l)
    (let (f (string libdir "/" (last (parse l "/"))))
      (unless (file? f)
        (begin
          (println "downloading " l " into " libdir)
          (if (starts-with "ERR: " (set 's (get-url l)))
            (throw-error s)
            (write-file f s))))
      (load f))))

(set 'loaded '())

; load module once through (load-store)
; remember module in 'loaded runtime list
(define (depend path)
  (unless (find path loaded)  
    (begin
      (load-store path)
      (push path loaded))))

(context 'MAIN)

This is the working prototype. If Lutz will accept to include similar into newlisp distro, then all we got simple module deploing scheme.

I also thinking about gpg signatures here, versioning and, possible, referencing a libs by a name from idx files.

If there will be an interest, the comments are welcome.
WBR, Dmi

newdep

#48
I like the idea's indeed... Though im realy realy bussy currently

and I cant get my fingers to hit the newlisp prompt... But feel free

to update nlist.lsp if you wish ofcourse ;-) If you want me to add

the features you have to wait a little..
-- (define? (Cornflakes))