Search found 100 matches

by alex
Tue Mar 21, 2006 12:03 pm
Forum: Anything else we might add?
Topic: (+) and (inc)
Replies: 1
Views: 1413

(+) and (inc)

(+) and (inc)

Code: Select all

newLISP v.8.8.0 on Win32 MinGW, execute 'newlisp -h' for more info.

> (setq num 2147483646)
2147483646
> (+ num 5)
-2147483645
> (inc 'num 5)
2147483651
>
Why?
by alex
Mon Mar 20, 2006 8:11 pm
Forum: Anything else we might add?
Topic: # About Code_Snippets:(cwd)
Replies: 2
Views: 1658

# About Code_Snippets:(cwd)

# About Code_Snippets:(cwd)
It can be shorter, I think:

Code: Select all

(define (cwd) (first (exec (if (= (& 0xF (last (sys-info))) 6) "cd" "pwd"))))
[/code]
by alex
Wed Mar 08, 2006 4:37 pm
Forum: newLISP Graphics & Sound
Topic: Minimalistic IDE :-)
Replies: 4
Views: 5430

Hi, newdep once more!
It must work.
Are You sure, that newlisp.exe in current direcriry?
by alex
Wed Mar 08, 2006 4:18 pm
Forum: newLISP newS
Topic: #offtopic: any-year.03.08 - woman day
Replies: 0
Views: 2261

#offtopic: any-year.03.08 - woman day

#It is the simplest example of object program: (println [text] I have (You must choose object!): 1.cat 2.dog 3.mother 4.wife 5.girl-friend [/text] ) (read-line) (println [text] Ha-Haaaaaaaaaaaa You are winner! You can kiss Your object!!!!! (as addon, may be) Press any key to continue... [/text] ) (...
by alex
Tue Mar 07, 2006 10:43 pm
Forum: newLISP Graphics & Sound
Topic: Minimalistic IDE :-)
Replies: 4
Views: 5430

Hi, newdep,
I like the trick too. It is not my own trick.
I saw the trick five-six years ago in bash (Linux, of course) and wrote own realisation of it, but "translation" to Windows is not very easy ;)
Windows has own tricks in running scripts and programs :(
by alex
Tue Mar 07, 2006 8:14 pm
Forum: newLISP Graphics & Sound
Topic: Minimalistic IDE :-)
Replies: 4
Views: 5430

Excuse me for my bad English, please. @goto RUNLISP # It is example of minimalistic IDE # (Integrated Development Environment) # # Because of some difficults in Windows2k-XP, # the script is writen with NewLisp orientation only :-( # # You MUST use Your app-file as parameter to the script # (and can...
by alex
Tue Feb 21, 2006 10:05 am
Forum: newLISP in the real world
Topic: Lots of memory
Replies: 8
Views: 4497

I got files short.txt and long.txt (write-file "short.txt" (dup "aaaaaaaaa\n" 1000000)) (write-file "long.txt" (dup (append (dup "b" 1000000) "\n") 10) ) and tests (setq dict (exec "type long.txt")) #test1 #(setq dict (exec "type short.txt")) #test2 #(setq dict (parse (read-file "long.txt") "\n")) #...
by alex
Mon Feb 20, 2006 1:59 pm
Forum: newLISP in the real world
Topic: Lots of memory
Replies: 8
Views: 4497

Under Linux we have such problems, or no?
by alex
Mon Feb 20, 2006 1:56 pm
Forum: newLISP Graphics & Sound
Topic: Minimalistic IDE :-)
Replies: 4
Views: 5430

Minimalistic IDE :-)

# It is example of minimalistic IDE # (Integrated Development Environment) # for newlisp and, may be, not only :-) # # You can choose Your own app-file and # Your own editor and define Your own # (compile-run) function. # # After You save app-file in editor # (hit Crtl-s in "notepad" for example), ...
by alex
Mon Feb 20, 2006 1:51 pm
Forum: newLISP in the real world
Topic: Lots of memory
Replies: 8
Views: 4497

It is not good, if it is so... :-(
by alex
Sat Feb 18, 2006 10:52 am
Forum: newLISP in the real world
Topic: Lots of memory
Replies: 8
Views: 4497

enrufull.dic.dos is big text file command "7za e -so enrufull.dic.dos.7z" extract it to standard output I think that problem may be in any "external" command. Example 2: I have text file eng1.txt (10119386 byte) and after command (setq my-dict (exec "type eng.txt")) before (read-line) my newlisp-pro...
by alex
Fri Feb 17, 2006 5:44 pm
Forum: newLISP in the real world
Topic: Lots of memory
Replies: 8
Views: 4497

Lots of memory

I have archive: E:\dict\enrufull>7za l enrufull.dic.dos.7z 7-Zip (A) 4.20 Copyright (c) 1999-2005 Igor Pavlov 2005-05-30 Listing archive: enrufull.dic.dos.7z Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------ 2006-02-15 19:15:18 ....A 37193160 104840...
by alex
Tue Feb 14, 2006 7:49 pm
Forum: Anything else we might add?
Topic: Remove line comment
Replies: 8
Views: 3911

I am sorry, it was version 2006.02.08 :-)
by alex
Mon Feb 13, 2006 1:50 pm
Forum: Anything else we might add?
Topic: Remove line comment
Replies: 8
Views: 3911

It can be shorter:

Code: Select all

# by Alex  version 2005.02.08
(define (no-comments src) (rest (chop (string (eval-string (append "'(" src ")"))))))
;)
by alex
Sat Feb 04, 2006 3:11 pm
Forum: Anything else we might add?
Topic: Studip question about (context):
Replies: 2
Views: 1714

I can't express my mind in english enough,
but it is very interesting information not only for me :-)
by alex
Sat Feb 04, 2006 3:08 pm
Forum: newLISP and the O.S.
Topic: "\n" and "\r"
Replies: 2
Views: 2808

I can't express my mind in english enough,
but it is very interesting information not only for me :-)
by alex
Thu Feb 02, 2006 7:40 pm
Forum: newLISP and the O.S.
Topic: "\n" and "\r"
Replies: 2
Views: 2808

"\n" and "\r"

I use WindowsXP and have simple program in file test.lsp:

Code: Select all

(print "\n\n\n\n\n")
(exit)
I run cmd.exe and execute command

Code: Select all

newlisp test.lsp > test.txt
Then I see, that size of file test.txt is 10 and it contain
"\n\r\n\r\n\r\n\r\n\r"
It is normal?
by alex
Thu Feb 02, 2006 6:48 pm
Forum: Anything else we might add?
Topic: Studip question about (context):
Replies: 2
Views: 1714

Studip question about (context):

What are reasons, that (context) is switch?
Why (context) is not standart lisp function?
Why we use

Code: Select all

(context 'BLA-BLA-BLA)
  ..............
(context 'MAIN)
against

Code: Select all

(context 'BLA-BLA-BLA
  ....................
)
?
by alex
Fri Dec 16, 2005 4:36 am
Forum: Whither newLISP?
Topic: Unexpected error
Replies: 4
Views: 4643

it first translates the code and creates a 'x' symbol in the current context ctx.

Code: Select all

> (context 'ctx)
ctx
ctx> (symbol? x)   #symbol 'x' creates
nil
ctx> (symbols)      #Yes, symbol 'x' exists
(x)
ctx> (symbol? x)   #No, we have no symbol 'x' !?
nil
ctx>
Why?!
by alex
Thu Dec 15, 2005 6:40 am
Forum: Whither newLISP?
Topic: Unexpected error
Replies: 4
Views: 4643

Unexpected error

Unexpected error. See below: G:\>newlisp newLISP v.8.7.2 on Win32 MinGW, execute 'newlisp -h' for more info. > (setq zzz:aaa 1) 1 > (context? zzz) true > (exit) G:\>newlisp newLISP v.8.7.2 on Win32 MinGW, execute 'newlisp -h' for more info. > (context? zzz) nil > (setq zzz:aaa 1) context expected in...
by alex
Mon Dec 12, 2005 8:13 am
Forum: Anything else we might add?
Topic: Remove line comment
Replies: 8
Views: 3911

My version :) (define (no-comments src) # Remove all comments from newlisp program # ATTENTION! The program must have RIGHT SYNTAX # Example: # (println (no-comments (read-file "prog.lsp"))) # (setq src (append "(let (____ (lambda ()\n" src "\n))(eval ____))")) (regex "^[(] *lambda *[(][)] *(.*) *[)...
by alex
Tue Dec 06, 2005 5:37 am
Forum: Anything else we might add?
Topic: String interpolation
Replies: 5
Views: 3172

Why You can't use (format) ?
by alex
Mon Dec 05, 2005 8:29 am
Forum: newLISP in the real world
Topic: Duplicate files on Your disk.
Replies: 12
Views: 7118

More powerful version of file-tree (define-macro (file-tree _dir _filter) ;; by alex ;; version 2005.12.02 ;; Returns a list of pairs (filename directory) ;; where filename satisfy to filter-function ;;(more precise - see code and examles) ;; ;; syntax: (file-tree dir [filter-function]) ;; syntax: (...
by alex
Tue Nov 29, 2005 10:14 am
Forum: newLISP in the real world
Topic: Duplicate files on Your disk.
Replies: 12
Views: 7118

To DMI:
yes, indeed.

Thanks all!
by alex
Mon Nov 28, 2005 12:17 pm
Forum: newLISP in the real world
Topic: Duplicate files on Your disk.
Replies: 12
Views: 7118

It is interesting, that test-code (define (main) (println "time1=" (time (setq li (file-tree "d:")) )) (println "time2=" (time (setq li (list-assoc li)) )) (println "time3=" (time (setq li1 (list-assoc (file-tree "d:"))) )) ) (setq t (time (main))) (println "full-time=" t) (exit) produce output: tim...