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 - Dmi

#31
newLISP newS / buffering of (print)
March 12, 2008, 03:11:51 AM
Hi, Lutz!



Just discover that
(while true (print ".") (sleep 1000))
started in command prompt shows all the output only after execution is finished.

Often this is not useful.

If this is a new behavior, then something like (flush), or, better, the output buffer configuration for particular handle, like in perl,  will be a good addition.
#32
Anything else we might add? /
March 02, 2008, 08:28:03 AM
Quote from: "Cyril"
There is exactly one of the points of common newlisp critique  from CL party: we have no macros. What is called "macro" in newlisp is called f-expr in most other lisps. I myself have found newlisp good enough for me, but there is a sad true here: no "before execution" time macro transformer.

That's right, but not exactly, bacause of nature of newlisp.

In fact we can already have a preprocessor that can parse already loaded context, using (symbols) etc. and transform any sequences of symbols and values into newlisp-compatible function calls. And no (reader) needed here despite it's great improvement either.



The bad news is that there's no stable and useful concept & technics for such transformations yet.
#33
Anything else we might add? /
March 02, 2008, 03:43:16 AM
Vote for named parameters!

I've playing with that once time before.

But there is a problem, and you can see it in your example just after typing 'f':
> f
(lambda-macro ()
 (letn ((_default '((a nil) (b 20) (c nil))) (_arglist (args)) (_offset-nil (find
     ': _arglist))
   (_offset-len
    (if _offset-nil
     _offset-nil
     (length _arglist)))
   (_pos-default (0 _offset-len _default))
   (_pos-arglist (0 _offset-len _arglist))
   (_key-arglist (_offset-len _arglist)))
  (map set (map first _default) (map last _default))
  (map set (map first _pos-default) (map eval _pos-arglist))
  (if (!= (% (length _key-arglist) 3) 0)
   (throw 'error))
  (dolist (_triple (explode _key-arglist 3))
   (local (_tag _key _val)
    (map set '(_tag _key _val) _triple)
    (if (!= _tag ':)
     (throw error))
    (set _key (eval _val))))
  (begin
   (list a b c))))

I found that this is very much code overhead, if that function will be called frequently.

So I've decide that there must be a sort of code preprocessor here, which will transform each combination of arguments used in a code to a short form of usage.

For ex: we have (f-internal a b c)

And (f :c 1) transforms to (f-internal nil nil 1) by preprocessor.



....but, if so, thinking in common, probably, here is a place for some engine that will allow to produce newlisp code from human-like language constructs.

But I have no idea here...
#34
newLISP newS /
February 26, 2008, 06:57:07 AM
Thanks, Lutz!
#35
newLISP Graphics & Sound /
February 26, 2008, 03:06:28 AM
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.
#36
newLISP newS /
February 25, 2008, 10:39:26 PM
Hmm.... As I can see libreadline doesn't needed in either termcap or ncurses/terminfo to be linked to newlisp (only libreadline itself depends libncurses)



This is mostly for information - the correction of makefile_debian isn't mandatory because debian packaging system will automatically patch for it once it was corrected.
#37
newLISP newS / -lncurses
February 25, 2008, 02:56:36 PM
Hi, Lutz!



Debian packaging script have reported that newlisp should not be linked with libncurses because no symbols used from it.



Rebuilding with -lncurses removed from makefile was successful.



Is it a real dependency?
#38
newLISP and the O.S. / Fresh Ubuntu package
February 23, 2008, 12:18:10 PM
Hello, guys!



Now I got an Ubuntu (gusty gibbon) installation on one of my stations.

So now U may add
deb http://en.feautec.pp.ru/debian/ gusty main
deb-src http://en.feautec.pp.ru/debian/ etch main

into your /etc/apt/sources.list and enjoy with debianized newlisp-9.3.1



PS. guiserver is checked at least with sun-java6-jre
#39
Anything else we might add? /
February 07, 2008, 06:35:07 AM
Hi, Lutz!



My needs was: code analyze/edit, reformat/reindent, sanitize (wrapping the string with (quote ) before eval-string is not a way in common).



What about Cyrill?
#40
Anything else we might add? /
February 07, 2008, 05:25:09 AM
Hi, Cyrill!



Look into http://en.feautec.pp.ru">http://en.feautec.pp.ru around newlisp console (nlc) project. There is some sort of a parser. Feel free to ask questions.



P.S. But, I think it would be cool to have a newlisp hardcoded engine (I suspect - a link to some existing internal function will be sufficient ;-)
#41
So, what can you actually DO with newLISP? /
January 28, 2008, 04:33:40 AM
Reworked one for Moscow stock exchange



http://en.feautec.pp.ru/SiteNews/MICEX">//http://en.feautec.pp.ru/SiteNews/MICEX
#42
Anything else we might add? /
January 14, 2008, 12:28:07 AM
Vote for that!
#43
newLISP in the real world / detecting symbolic links
January 14, 2008, 12:01:37 AM
$ ln -s "." test
$ newlisp
> (directory "test")
true

So I can make a file symlinks, which will cycle the file tree iterators, or will go through mounted filesystems which is not always attended.



But in most other cases following symlinks is very useful because it is a regular Unix convention.



Can we have an option for (directory?) which will trigger symlink detection?
#44
Anything else we might add? /
December 06, 2007, 05:00:02 AM
I've found newLISP in a post in http://www.linux.org.ru/">//http://www.linux.org.ru/
#45
newLISP Graphics & Sound /
December 03, 2007, 08:31:17 AM
Thanks!



gs:window works fine in linux and win.