Search found 171 matches
- Tue Jun 05, 2007 1:05 am
- Forum: Anything else we might add?
- Topic: reading utf16 files?
- Replies: 21
- Views: 10587
Wow, things look interesting with that same code on windows newLISP v.9.1.1 on Win32 UTF-8, execute 'newlisp -h' for more info. > (print "\230\162\182\230\181\166\231\148\177\232\168\152") 梶浦由記"梶浦由記" > (write-file "\230\162\182\230\181\166\231\148\177\232\168\152" "Hello Unicode") 13...
- Tue Jun 05, 2007 12:10 am
- Forum: Anything else we might add?
- Topic: reading utf16 files?
- Replies: 21
- Views: 10587
Thanks Lutz, I gave that a try but still didn't have any luck. I have a file with the path "F:\test\梶浦由記\file.txt" I run the following (in the "test" directory) with the following result. F:\test>newlispw -e "(directory)" ("." ".." "????") (note: newlispw = UTF8 enabled newlisp) Hoping it's just a c...
- Mon Jun 04, 2007 11:09 pm
- Forum: Anything else we might add?
- Topic: reading utf16 files?
- Replies: 21
- Views: 10587
This may not be the fastest approach, or even the most accurate, but it seemed to work in my tests. (define (utf16->utf8 s) (join (map (fn (c) (utf8 (append (reverse c) "\000\000\000\000\000\000")) ) (find-all ".." s) ) ) ) And speaking of Unicode files, does anyone (Lutz ;) know how to open a file ...
- Tue May 22, 2007 5:11 pm
- Forum: Anything else we might add?
- Topic: The big 0x1c today...
- Replies: 3
- Views: 2531
- Fri May 11, 2007 4:36 pm
- Forum: Anything else we might add?
- Topic: Nested contexts
- Replies: 7
- Views: 4005
Hi Jeff You're not alone. I ran into the same problem when working on a newlisp object system inspired by Python. It would be really nice to be able to simply write a-bar:foo:some-value. Since I couldn't, I wrote this macro to handle cases when I had contexts inside contexts. Usage: To get a value (...
- Sun May 06, 2007 1:35 pm
- Forum: newLISP newS
- Topic: revision 1 of Manual and Reference 9.1
- Replies: 6
- Views: 4393
bind
Not sure where to post this, but I just noticed a primitive function (bind) in newLISP v9.1.1 on Win32. Checked the manual, searched the boards and the net, but I can't find any documentation on the function.
Am I missing something?
Am I missing something?
- Thu Mar 29, 2007 11:24 pm
- Forum: Anything else we might add?
- Topic: newlisp object system
- Replies: 4
- Views: 2621
newlisp object system
I have been porting some code from Python to newlisp during the last few weeks. During this process I have recreated some of the Python libraries. I have also taken a good long look at how I want to mimic the object-oriented functionality of Python. This is what I came up with. This function does mo...
- Wed Mar 28, 2007 1:33 am
- Forum: newLISP newS
- Topic: Interview with Dr newLISP...
- Replies: 3
- Views: 2221
- Wed Mar 28, 2007 1:24 am
- Forum: Anything else we might add?
- Topic: Help with match
- Replies: 4
- Views: 3094
- Wed Mar 28, 2007 1:07 am
- Forum: Anything else we might add?
- Topic: deleting lines from a text file
- Replies: 5
- Views: 2783
So you have a text file like this? Line 1 <some> 2 <some> ... 21 <some> 22 ------- 23 <some> 24 <some> 25 <some> ... n "another string" ... eof You want to remove lines 1 to 24, then find "another string" and delete from there to the end of the file? After your line of code, something like this migh...
- Fri Mar 23, 2007 6:16 pm
- Forum: Anything else we might add?
- Topic: Help with match
- Replies: 4
- Views: 3094
Looks like a quoting issue (it always throws me off too). From the newlisp interpreter > '( * 1 * 2 *) (* 1 * 2 *) > '( * a * b *) (* a * b *) They evaluate to different things, so it makes sense that match would have different results. But if you try > (list '* a '* b '*) (* 1 * 2 *) then the symbo...
- Fri Mar 23, 2007 4:59 pm
- Forum: newLISP and the O.S.
- Topic: binary data through stdin
- Replies: 9
- Views: 7263
Ah ha! I didn't know the source of the setmode() function was in a DLL. That really does make it easy. It's a simple function, Windows specific, and I assume that the C code I posted originally was just calling the DLL anyway. Having a conditional import (only when in Windows) solves the problem and...
- Thu Mar 22, 2007 5:27 am
- Forum: newLISP and the O.S.
- Topic: binary data through stdin
- Replies: 9
- Views: 7263
Thanks for taking the time to provide all your feedback, and for the many very speedy replies. Using a straight through pipe unfortunately doesn't tell me very much because it's both reading as text, then writing as text. The mangling translation through stdin is negated when translated again throug...
- Thu Mar 22, 2007 1:39 am
- Forum: newLISP and the O.S.
- Topic: binary data through stdin
- Replies: 9
- Views: 7263
Thanks for the reply Lutz. I had tried read-buffer, but unfortunately it still seemed to read it in text mode. Here's some code to create a file full of "\r\n" (set 'handle (open "aFile.ext" "write")) (write-buffer handle (dup "\r\n" 10)) (close handle) Looking at the file "aFile.ext" in a hex edito...
- Thu Mar 22, 2007 12:00 am
- Forum: newLISP and the O.S.
- Topic: binary data through stdin
- Replies: 9
- Views: 7263
binary data through stdin
I currently have a need to read binary data that is piped in from stdin in Windows (in particular I'm writing some cgi scripts). I've had this need before when running transformations on binary data piped from the command-line. Unfortunately, since this is Windows, and since stdin is open in text mo...
- Thu Mar 15, 2007 4:11 pm
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
- Thu Mar 15, 2007 3:55 pm
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
Thanks again cormullion (folks sure are nice in these forums :) Here are a few other things I've just tried (println (string (list (dup nil 600)))) (println (string (dup "x" 2048) "END" )) When I run each of those programs, the output gets cut-off with garbage. It seems it has something to do with (...
- Thu Mar 15, 2007 2:40 pm
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
Thanks for your help with this cormullion. The problem shows up after displaying about 2048 characters, tested with the following: (println (string (array 1 (list (dup "x" 2048)) ) )) Here's another variation of code who's output is cut-off/show garbage (set 'a (string (array 600))) (println a) The ...
- Thu Mar 15, 2007 3:28 am
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
Turns out most of that code is inconsequential.
This will produce the same results.
newlisp-tk also exhibits the strange behavior.
Code: Select all
(println (string (array 600)))
newlisp-tk also exhibits the strange behavior.
- Wed Mar 14, 2007 9:57 pm
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
Thanks for checking it HPW, newdep, and cormullion. I guess the problem only appears when you load the code from a file at the command-line. C:\>newlisp test.lsp (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil n...
- Wed Mar 14, 2007 7:01 pm
- Forum: newLISP newS
- Topic: newLISP version 9.1 Release
- Replies: 25
- Views: 14084
(new empty_context), (array), (println (string)) bug?
This is my first post, and I have to say I absolutely love using newlisp. These forums have been very helpful, and I've managed to do some very beautiful things with the language. Unfortunately, my first post deals with some strange behavior I've run across. The following code fails to print the ent...