Search found 28 matches
- Wed Jun 23, 2010 4:45 am
- Forum: newLISP and the O.S.
- Topic: Finding the attributes of Chinese filenames (Win32)
- Replies: 5
- Views: 4810
Re: Finding the attributes of Chinese filenames (Win32)
@m35, your help is very much appreciated. It seems a little weird to me doing the slice on the reverse of the bits but I couldn't find any bit_and functionality anywhere (quickly). Thanks, Bruce. ;code from m35 (constant 'SIZEOF_WCHAR 2) ; assumption (constant 'CP_UTF8 65001) (define (utf8->16 lpMul...
- Wed Jun 23, 2010 3:12 am
- Forum: newLISP and the O.S.
- Topic: Finding the attributes of Chinese filenames (Win32)
- Replies: 5
- Views: 4810
Re: Finding the attributes of Chinese filenames (Win32)
Wow, cool code!
Perhaps I'm not seeing something that's right in front of me, but the manual doesn't say anything about returning the 'archive bit' status when using file-info.Is there a reason you can't use the built in file-info function?
- Tue Jun 22, 2010 2:32 am
- Forum: newLISP and the O.S.
- Topic: Finding the attributes of Chinese filenames (Win32)
- Replies: 5
- Views: 4810
Finding the attributes of Chinese filenames (Win32)
The following NewLISP code shows me the file attributes of files under Win32. However, some of the filenames retrieved have Chinese characters in the name. When the GetFileAttributesA function encounters them, it gives me a -1 for the attribute. I looked at GetFileAttributesW but don't know how to m...
- Sun Jan 17, 2010 7:04 am
- Forum: newLISP in the real world
- Topic: Parsing another lisp-ish language
- Replies: 5
- Views: 2201
Re: Parsing another lisp-ish language
kks,
Yes, that's marvellous. Thanks very much. I can now get on with the rest of the project (and figure out why your fix works.)
Kind regards,
Bruce.
Yes, that's marvellous. Thanks very much. I can now get on with the rest of the project (and figure out why your fix works.)
Kind regards,
Bruce.
- Sat Jan 16, 2010 3:01 pm
- Forum: newLISP in the real world
- Topic: Parsing another lisp-ish language
- Replies: 5
- Views: 2201
Re: Parsing another lisp-ish language
Nope. Dead end. s(setq res "") (define (proc procode) (local (codelen code separator elider) (begin (setq codelen (length procode)) (for (i 0 (- codelen 1) 1) (begin (setq code (procode i)) (when (= i 0) (setq res (append res "<@ " (string code) ">" ))) ;at this point, check to see whether OMT and S...
- Sat Jan 16, 2010 2:58 pm
- Forum: newLISP in the real world
- Topic: Parsing another lisp-ish language
- Replies: 5
- Views: 2201
Re: Parsing another lisp-ish language
I think I've got it partly figured out. Still have to come up with a solution, though. (when (> i 0 ) (if (list? code) (proc code) (atom? code) (setq res (append res (string code) ) ) ) (if (< i (- codelen 1)) (begin (setq res (append res separator )) ) ) ) When one returns from the 'proc' routine, ...
- Sat Jan 16, 2010 8:20 am
- Forum: newLISP in the real world
- Topic: Parsing another lisp-ish language
- Replies: 5
- Views: 2201
Parsing another lisp-ish language
G'day everyone I'm writing a translator which will take a Lisp-ish way of writing a language and outputting it in a more XML-ish form. This means taking this: (sai (ITEFORLITLITLITLIT 999999999 1 1 (SAYOPRCAP (SAYVALFOR ...) "thing"))(sayvar goose)) and changing it into this: <@ sai><@ ITEFORLITLITL...
- Fri May 01, 2009 4:46 am
- Forum: Whither newLISP?
- Topic: Complex numbers and multiple answers
- Replies: 3
- Views: 3394
Complex numbers and multiple answers
G'day everyone W.r.t. complex numbers, how easy would it be to have (sqrt -1) return (0.0 1.0) and on the question of multiple answers, there are two correct answers to the square root of 4 (sqrt 4) --> (2 -2) Could there be a way in future newLISPs to be able to do complexes and also some system se...
- Wed Apr 15, 2009 8:13 am
- Forum: So, what can you actually DO with newLISP?
- Topic: Twitter command-line utility update v.03
- Replies: 9
- Views: 6861
Re: Twitter command-line utility update v.03
Lutz, Here's my take on the twitter.lsp (v0.3ax) which uses my linked? and command-line stuff. This way the script can be executed either by newlisp.exe on the commandline or after use of link.lsp. Kind regards, Bruce. #!/usr/bin/newlisp ; post, delete and see user and friends messages and followers...
- Wed Apr 15, 2009 6:45 am
- Forum: newLISP in the real world
- Topic: How do I detect if a script is "linked" or not
- Replies: 2
- Views: 1533
Re: How do I detect if a script is "linked" or not
Change the link.lsp program so that after the script to be appended is loaded into memory, push a (set 'link.lsp? true) flag to the front of the code string, before the string is written to the .exe file being created. ... -- xytroxon Therein lies the difference between the guru and the disciple. M...
- Tue Apr 14, 2009 2:52 am
- Forum: newLISP in the real world
- Topic: How do I detect if a script is "linked" or not
- Replies: 2
- Views: 1533
How do I detect if a script is "linked" or not
G'day everyone With this code ;margs.lsp (dolist (i (main-args)) (println $idx ": " i)) (exit) If I evaluate it using the interpreter I get the following >newlisp margs.lsp 1 2 3 0: newlisp 1: margs.lsp 2: 1 3: 2 4: 3 but if I link it using link.lsp I get the similar stuff but in different places >e...
- Sun Apr 12, 2009 3:30 pm
- Forum: Whither newLISP?
- Topic: need an enhanced (for)
- Replies: 3
- Views: 3302
(setq j 20) (for (i 1 10 1 (= j 0)) (println (string "i=" i "j=" j)) (setq j (- j 2)) ) However, what I ended up doing was: (setq i ?TestRange1Low) (setq j ?TestRange2Low) (while (and (!= i ?TestRange1High) (!= j ?TestRange2High)) (begin (inc i ?TestIncr1) (inc j ?TestIncr2) ) ) which, whilst not b...
- Sun Apr 12, 2009 1:02 pm
- Forum: Whither newLISP?
- Topic: need an enhanced (for)
- Replies: 3
- Views: 3302
Wow, would never of thought of that approach. Thanks!!HPW wrote:Code: Select all
(setq j 20) (for (i 1 10 1 (= j 0)) (println (string "i=" i "j=" j)) (setq j (- j 2)) )
Kind regards,
Bruce.
- Sun Apr 12, 2009 9:49 am
- Forum: Whither newLISP?
- Topic: need an enhanced (for)
- Replies: 3
- Views: 3302
need an enhanced (for)
G'day everyone I'm not sure how I'd handle this, as I'm just thinking about it now, but how would one implement a (for) that had two indices rather than the usual one? For example (pseudopseudocode): for i = 1 to 10 with j=20 to 2 step -2 do println i,j next The usual thing is to have the for j insi...
- Fri Apr 10, 2009 3:39 pm
- Forum: newLISP and the O.S.
- Topic: interface to CScript.EXE (VBScript)
- Replies: 2
- Views: 3011
Oh wow, that looks so cool. I've gotta try that out real soon.m35 wrote:Good to see you're exploring and trying new things. You might also be interested in this. ;)
Thanks.
Bruce.
- Thu Apr 09, 2009 5:13 pm
- Forum: newLISP in the real world
- Topic: (join (args)) and mixed data types?
- Replies: 1
- Views: 1166
(join (args)) and mixed data types?
G'day everyone Pardon my naivete, but I'm having trouble with (join (args)) in that I'm expecting to get a string out of it, but it fails when items in the args are non-string. For example (define (tracer) (begin (set 'str (join (args))) (append-file "trace.log" str) (print str) ) ) (tracer 1 0.2 "d...
- Thu Apr 09, 2009 4:22 pm
- Forum: newLISP and the O.S.
- Topic: interface to CScript.EXE (VBScript)
- Replies: 2
- Views: 3011
interface to CScript.EXE (VBScript)
G'day everyone Here's something I just cooked up as part of a test frame. It's a way of evaluating VBScript code from newLISP. (define (vbscript text) (begin (set 'aFile (open "c:/temp/temp.vbs" "write")) (write-line aFile (string text)) (close aFile) (exec "cmd.exe /C c:\\windows\\system32\\cscript...
- Thu Apr 09, 2009 2:40 pm
- Forum: newLISP newS
- Topic: Promoting my blog.
- Replies: 61
- Views: 35125
Very interesting blog, axtens. Impressive number of programming languages. I encourage everyone to start writting blog because it really helps. Helps in what? To initiate or increase communication about topics you want to communicate. Thanks for the encouragement. Yes, maintaining a weblog is good ...
- Thu Apr 09, 2009 4:11 am
- Forum: newLISP newS
- Topic: Promoting my blog.
- Replies: 61
- Views: 35125
While we're on the subject of blogs, I've just made my first newLISP posting on my own blog
Kind regards,
Bruce.
Kind regards,
Bruce.
- Wed Apr 08, 2009 3:06 pm
- Forum: newLISP in the real world
- Topic: NEWBIE: bug in (count)?
- Replies: 2
- Views: 1426
- Wed Apr 08, 2009 2:00 pm
- Forum: newLISP and the O.S.
- Topic: newLISP on Windows 7
- Replies: 0
- Views: 3001
newLISP on Windows 7
Just in case anyone's curious, newLISP runs fine under Windows 7. I did have to install Java to run the IDE, but apart from that everything worked straight out of the box. I'm getting closer to giving up on XP completely and going for W7, beta status notwithstanding. It's really is a very nice envir...
- Wed Apr 08, 2009 1:52 pm
- Forum: newLISP in the real world
- Topic: find is like Instr, what's like RevInstr?
- Replies: 3
- Views: 1764
I think you are progressing quite good. Are you experienced programmer? Yes, just not in Lisp. I've been in the IT business in various ways since 1983. At the moment I'm working for The Protium Project and MyTongue as a Software/Test Engineer. I program in a variety of languages, including Ada, ass...
- Wed Apr 08, 2009 1:10 pm
- Forum: newLISP in the real world
- Topic: find is like Instr, what's like RevInstr?
- Replies: 3
- Views: 1764
Re: find is like Instr, what's like RevInstr?
What is the equivalent for VBScript's RevInstr() wherein one searches for the first occurrence from the other end of the string? (find (reverse))? I think I'll have a go at answering my own question. (set 'reverse-find (lambda (findThis inThis) (- (length inThis) (find (reverse findThis) (reverse i...
- Wed Apr 08, 2009 10:40 am
- Forum: newLISP in the real world
- Topic: find is like Instr, what's like RevInstr?
- Replies: 3
- Views: 1764
find is like Instr, what's like RevInstr?
G'day everyone
(find) is like VBScript's Instr(). What is the equivalent for VBScript's RevInstr() wherein one searches for the first occurrence from the other end of the string? (find (reverse))?
Kind regards,
Bruce.
(find) is like VBScript's Instr(). What is the equivalent for VBScript's RevInstr() wherein one searches for the first occurrence from the other end of the string? (find (reverse))?
Kind regards,
Bruce.
- Wed Apr 08, 2009 8:45 am
- Forum: newLISP in the real world
- Topic: A better way to do this?
- Replies: 4
- Views: 1844
Thanks for the welcome. And thanks for the help with the code -- much appreciated!!Lutz wrote:
or even better:
ps: welcome to newLISPCode: Select all
(set 'm (apply find (list k l 1))