Search found 15 matches

by shercipher
Sun May 24, 2009 9:15 pm
Forum: newLISP in the real world
Topic: Hashes
Replies: 2
Views: 1476

Okay so all I have to do is evaluate the symbol from dotree.
by shercipher
Thu May 21, 2009 10:02 pm
Forum: newLISP in the real world
Topic: Hashes
Replies: 2
Views: 1476

Hashes

Why does this work?

Code: Select all

(new Tree 'hash)
(hash "x" 0)
(hash "y" 1)
(hash "z" 2)

(hash "x")
0
But this not work?

Code: Select all

(dotree (x hash)
 (print x " " (hash x) " "))
by shercipher
Wed May 20, 2009 10:32 pm
Forum: newLISP in the real world
Topic: first gives errors on empty lists
Replies: 3
Views: 1703

Right, maybe this is just another "nil is not ()" difference with Common Lisp. Sorry, CL was what taught me how to think Lisp.
by shercipher
Wed May 20, 2009 7:20 pm
Forum: newLISP in the real world
Topic: first gives errors on empty lists
Replies: 3
Views: 1703

first gives errors on empty lists

Calling (first) on an empty list gives an error instead of returning the empty list. This is inconsistent with the documentation, which claims that first behaves the same as car in other Lisp implementations. On the contrary, ; sbcl This is SBCL 1.0.18.debian, an implementation of ANSI Common Lisp. ...
by shercipher
Sun May 17, 2009 11:18 pm
Forum: newLISP in the real world
Topic: List access times versus array access times
Replies: 1
Views: 1299

List access times versus array access times

For very large lists/arrays, what is the time improvement for accessing the last element of either structure? I imagine that for arrays, the time taken to access the last element is flat, but for lists grows as the list size grows. Do arrays have restrictions on size (e.g., can't be indexed past the...
by shercipher
Fri May 15, 2009 5:15 pm
Forum: newLISP in the real world
Topic: How to make newLISP quiet when it starts; start with ()
Replies: 10
Views: 24166

You can turn off prompts with the -c option. Don't know how to get a () (I don't think readlines even supports that, emacs probably does). There doesn't seem to be a quiet or suppress option; that needs to be added.
by shercipher
Thu May 14, 2009 5:44 pm
Forum: newLISP newS
Topic: newLISP development release v.10.0.5
Replies: 11
Views: 6768

I don't see anything on the newLisp website guaranteeing that the API is stable anyway. If he wants to remove something or change its behavior, the worst you have to do is probably a find-replace. Unless the behavior of a fundamental, commonly used function is totally changed, which isn't what this ...
by shercipher
Thu May 14, 2009 4:18 am
Forum: newLISP in the real world
Topic: I suppose there is no progn
Replies: 2
Views: 1554

I suppose there is no progn

For expressions that need to be evaluated sequentially in newLisp, there is no progn special form that says "evaluate these and return the last". So how do I make code like this valid? (if (expr) ((eval 1) (eval 2) (eval3)) (eval4)) It seems to execute the forms correctly, except that at the end of ...
by shercipher
Tue May 12, 2009 6:03 am
Forum: newLISP in the real world
Topic: Importing C libraries
Replies: 2
Views: 1565

Too late, already wrote my own function. Will consider replacing if necessary later (I have doubts that mine works correctly).
by shercipher
Tue May 12, 2009 4:02 am
Forum: newLISP in the real world
Topic: Importing C libraries
Replies: 2
Views: 1565

Importing C libraries

I need to use the SHA1 function in libssl.so. The function has the following syntax: unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md); With the explanation SHA1() computes the SHA-1 message digest of the n bytes at d and places it in md (which must have space for SHA_D...
by shercipher
Mon May 11, 2009 4:06 am
Forum: newLISP Graphics & Sound
Topic: objects in guiserver
Replies: 2
Views: 4704

In CL the answer would be macros. In NL I'm pretty sure the answer is still macros. What exactly are you trying to accomplish (explain)?
by shercipher
Mon May 11, 2009 4:05 am
Forum: Whither newLISP?
Topic: Macros need explanation
Replies: 11
Views: 7139

I think you can in Scheme define if as a function; however, in CL, because the rest of a list is evaluated before the head is, if must be a special form, and cannot be written as a function.
by shercipher
Mon May 11, 2009 1:52 am
Forum: Whither newLISP?
Topic: Macros need explanation
Replies: 11
Views: 7139

I don't understand this misconception that Common Lisp/Scheme are faster just because they are compiled. In most benchmarks they perform worse than Perl (which we'll call a "fast" interpreted language) even when speed 3 safety 0 is on. When I saw the mergesort benchmark, I was pretty impressed; newL...
by shercipher
Sun May 10, 2009 5:36 pm
Forum: Whither newLISP?
Topic: newLISP coding form
Replies: 13
Views: 8145

I'm knew CL first, so the closing ) on their own lines looks wrong to me. Stacking parentheses on the end of lines has always seemed the logical thing to do (unlike }'s, which look ugly when stacked together).
by shercipher
Sun May 10, 2009 5:27 pm
Forum: Whither newLISP?
Topic: Macros need explanation
Replies: 11
Views: 7139

Macros need explanation

I hail from Common Lisp, where the entire idea of macros is completely different, it seems, from that of newLisp. Could someone please explain to me exactly what a newLisp macro does? Does it evaluate its body and not evaluate its inputs? Or does it evaluate its inputs but not its body? How can I us...