Search found 30 matches
- Fri Mar 14, 2008 4:40 am
- Forum: newLISP newS
- Topic: newLISP and an SCM?
- Replies: 8
- Views: 5096
http://repo.or.cz/w/newlisp.git Homepage of the newLISP development Git mirror. If you have Git installed, use this to get the a clone of the repo: git clone git://repo.or.cz/newlisp.git Then use this in the repo directory to receive updates: git pull I'll update this whenever Lutz releases a new d...
- Thu Mar 13, 2008 5:30 pm
- Forum: newLISP newS
- Topic: newLISP and an SCM?
- Replies: 8
- Views: 5096
newLISP and an SCM?
Lutz, do you think that you could start using an SCM (preferably Git) to track changes to newLISP, and hosting a public repo? I'd like to have access to the latest, cutting-edge version of newLISP to help change the code in any way I can, and I think many others would like that, too.
- Fri Feb 15, 2008 7:15 pm
- Forum: newLISP newS
- Topic: "Autocurrying?"
- Replies: 2
- Views: 2636
"Autocurrying?"
I've started to learn F# (a OCaml-like language for .NET), and one feature that really struck me is automatic currying. Here's a newLISP-syntax example of what I mean (it is not valid newLISP code): (define (add-nums a b) (+ a b) (setq add10 (add-nums 10)) (add10 3) ; => 13 Basically, when you "call...
- Mon Dec 24, 2007 7:51 pm
- Forum: newLISP newS
- Topic: RC4 Encryption for newLISP
- Replies: 3
- Views: 2906
- Mon Dec 24, 2007 8:38 am
- Forum: newLISP newS
- Topic: RC4 Encryption for newLISP
- Replies: 3
- Views: 2906
RC4 Encryption for newLISP
http://kinghajj.ath.cx/rc4-nl.tar.bz2 ; example usage (rc4-encrypt (rc4-encrypt "Hello!" "World")) ; => "Hello!" RC4 is much better than a one-time pad for practical applications. I would have implemented this is a primitive, builtin function, but the documentation doesn't cover that. It'd be much ...
- Sun Nov 11, 2007 12:14 am
- Forum: newLISP newS
- Topic: A simple minimal OO system for newLISP
- Replies: 47
- Views: 31429
I made some improvements to my define-class module.
- -The functions documented with newlispdoc.
-Instead of "inherits", the keyword is now "mixin" or "mixins".
-Each class can now mixin more than one other class.
- Fri Nov 09, 2007 5:01 am
- Forum: newLISP newS
- Topic: A simple minimal OO system for newLISP
- Replies: 47
- Views: 31429
OK, Here's the code to my "define-class" macro. There's one little issue with the attribute setters, in that they do not modify the original data, but rather make a new object with the changed attribute. However, because newLISP encourages this sort of style, maybe it will stay this way. ;;;;;;;;;;;...
- Thu Nov 08, 2007 7:36 am
- Forum: newLISP newS
- Topic: A simple minimal OO system for newLISP
- Replies: 47
- Views: 31429
Looking at Michael's code, I noticed that there are many redundancies with making classes. How about a macro to define classes? ;; D I S P L A Y A B L E (define-class (displayable) (define (string) (string self)) (define (print) (println (:string self)))) ;; P O I N T (define-class (point (x 0) (y 0...
- Sun Sep 16, 2007 8:01 am
- Forum: newLISP newS
- Topic: development release newLISP v.9.2.1
- Replies: 13
- Views: 8826
But the point is that the code I wrote, while useless, should not crash the program.newBert wrote:Maybe :kinghajj wrote:I got a segmentation dump when trying dostring.
Code: Select all
> (dostring (c "hello") c) Segmentation fault (core dumped)
works better !Code: Select all
> (dostring (c "hello") (println c))
;)
- Sun Sep 16, 2007 6:53 am
- Forum: newLISP newS
- Topic: development release newLISP v.9.2.1
- Replies: 13
- Views: 8826
I got a segmentation dump when trying dostring.
Code: Select all
> (dostring (c "hello") c)
Segmentation fault (core dumped)
- Sat Sep 15, 2007 9:02 pm
- Forum: newLISP newS
- Topic: Idea to increase numeric accuracy in newLISP
- Replies: 3
- Views: 2981
64-bit OSes are usually near-100% compatible with their 32-bit counterparts. The 64-bit versions of Windows, for example, have a special library that re-implements 32-bit Windows on 64-bit Windows, allowing you to run any 32-bit program. I'm sure that Mac OS X will be no different. The main advantag...
- Sat Sep 15, 2007 6:49 am
- Forum: newLISP newS
- Topic: Idea to increase numeric accuracy in newLISP
- Replies: 3
- Views: 2981
Idea to increase numeric accuracy in newLISP
I use a 64-bit Linux distro, so this suggestion might not apply to all versions of newLISP. I've written a very simple Reverse Polish Notation calculator in C. To store numbers, the data type I chose was "long double." With this, I am able to calculate large numbers such as 2^2048 (*). In newLISP, h...
- Fri Sep 14, 2007 5:27 pm
- Forum: newLISP newS
- Topic: define-struct
- Replies: 4
- Views: 3418
- Fri Sep 14, 2007 4:04 pm
- Forum: newLISP newS
- Topic: define-struct
- Replies: 4
- Views: 3418
define-struct
Somebody mentioned wanting a defstruct macro in newLISP, so here's my attempt at implementing one. (define (truncate lst size) (let ((len (length lst))) (if (<= len size) (append lst (dup nil (- size len))) (chop lst (- len size))))) (define-macro (define-struct params) (let ((items (args)) (struct-...
- Thu Sep 13, 2007 9:06 am
- Forum: newLISP newS
- Topic: newLISP Database
- Replies: 4
- Views: 3627
Wow, that is a much cleaner version of truncate! Here's a more concise version.
I'll use this in the next release. Thanks.
Code: Select all
(define (truncate lst size)
(let ((len (length lst)))
(if (<= len size)
(append lst (dup nil (- size len)))
(chop lst (- len size)))))
- Wed Sep 12, 2007 11:32 pm
- Forum: newLISP newS
- Topic: newLISP Database
- Replies: 4
- Views: 3627
newLISP Database
I wrote this up quickly last night and this afternoon. It's a database library written completely in newLISP. It's very simple, but I'll make it more capable in later releases. I wrote this because I didn't want to deal with SQL. I suppose I could have written a wrapper around the sqlite3 library fo...
- Wed Sep 12, 2007 10:22 pm
- Forum: newLISP newS
- Topic: Contexts as Objects
- Replies: 42
- Views: 33334
Re: Contexts as Objects
I wrote a post at http://kinghajj.blogspot.com/2007/09/contexts-as-objects-in-newlisp.html detailing how to use contexts to implement classes and objects in newLISP. Nice entry -- short and sweet. BTW, there is an error (really, a typo causing an error) in your code: (context 'Point) (define (Point...
- Mon Sep 10, 2007 10:57 pm
- Forum: newLISP newS
- Topic: newLISP unit tests
- Replies: 1
- Views: 2162
newLISP unit tests
I was reading the book Practical Common Lisp, and found a great implementation of unit tests in Common Lisp. So, I thought I'd re-make them (in my own way, of course,) in newLISP. nltests.lsp ;; nltests.lsp -- testing macros ;; Copyright (C) 2007 Samuel Fredrickson. (context 'nltests) ; used to repo...
- Sun Sep 09, 2007 9:09 am
- Forum: newLISP newS
- Topic: Contexts as Objects
- Replies: 42
- Views: 33334
- Sun Sep 09, 2007 7:25 am
- Forum: newLISP newS
- Topic: Contexts as Objects
- Replies: 42
- Views: 33334
Contexts as Objects
I wrote a post at http://kinghajj.blogspot.com/2007/09/contexts-as-objects-in-newlisp.html detailing how to use contexts to implement classes and objects in newLISP. I've just discovered this--though I'm probably not the first--so I haven't found out all that you can do with this. Hope you enjoy it.
- Sat Sep 08, 2007 7:20 am
- Forum: newLISP newS
- Topic: (apply case) doesn't work as expected
- Replies: 3
- Views: 2935
I wrote a simple macro that will work like apply, but works correctly with case.
Code: Select all
(define-macro (myapply func arglist)
(eval (cons func (eval arglist))))
- Sat Sep 08, 2007 7:03 am
- Forum: newLISP newS
- Topic: (apply case) doesn't work as expected
- Replies: 3
- Views: 2935
(apply case) doesn't work as expected
These two pieces of code should be equivalent, correct? But they are not. (apply case ...) doesn't work.
Code: Select all
(apply case '(1 (1 2)))
(case 1 (1 2))
- Wed Sep 05, 2007 10:16 pm
- Forum: newLISP newS
- Topic: problem with tabs in newlisp-edit/newlisp-gs
- Replies: 4
- Views: 3692
- Wed Sep 05, 2007 6:40 am
- Forum: newLISP newS
- Topic: problem with tabs in newlisp-edit/newlisp-gs
- Replies: 4
- Views: 3692
problem with tabs in newlisp-edit/newlisp-gs
the newlisp-gs editor does not interpret tabs well. instead of defining a tab to look like 1, 2, 3 or 4 spaces, it seems to use a number above 1.5 but below 2. This is not very aesthetic, and I think that this number should be user-specified in the settings file. The first function uses tabs, while ...
- Thu Aug 30, 2007 3:09 am
- Forum: newLISP newS
- Topic: Should there be a backquote in newLISP?
- Replies: 3
- Views: 3042
I saw in a search of the forums that Lutz doesn't like backquotes, so I've come up with a possible solution. I've implemented a backquote-like feature with a macro. ; takes an item from the template and decides whether to evaluate it or not. ; if the item starts with an "@" and is a symbol, then ret...