Search found 156 matches

by newBert
Thu May 22, 2008 8:41 am
Forum: Anything else we might add?
Topic: Why Arc is bad for exploratory programming...
Replies: 29
Views: 15510

Nevertheless the choice of names is important.

Next to FIRST/BUTFIRST, LAST/BUTLAST is conceivable.

;-)
by newBert
Wed Apr 09, 2008 4:12 pm
Forum: newLISP newS
Topic: Parsing problem
Replies: 1
Views: 1581

If you type: > (parse s "[\\]]" 0) Note the position of 's' (before the regex ) You get: ("[Event this is the first event [Event this is the second event [Event and this is the third") Is this what you expect ? Sorry, I didn't see: UPDATE: uh--- Duh! How about wrong order of parameters in parse? Ign...
by newBert
Thu Apr 03, 2008 7:58 am
Forum: newLISP newS
Topic: development release newLISP v. 9.3.6
Replies: 6
Views: 3477

To remove hash associations, just set them to nil Ah, and it's even simpler than I thought :) Perhpas what confuses you, is the fact that in namespace hashing (invent) recturns an association list. Yes and, for my purpose, association lists are quite sufficient and more convenient. But I'll remembe...
by newBert
Wed Apr 02, 2008 10:01 am
Forum: newLISP newS
Topic: development release newLISP v. 9.3.6
Replies: 6
Views: 3477

Dictionnary in NL-9.3.6

Hello, How to delete an association in a dictionnary (newLisp-3.9.6)? (define invent:invent) (map invent '("apples" "bananas" "oranges" "pears") '(430 312 274 137)) (println (invent)) ;-> (("apples" 430) ("bananas" 312) ("oranges" 274) ("pears" 137)) To remove an association I must do this: (set 'ls...
by newBert
Tue Mar 18, 2008 2:18 pm
Forum: newLISP newS
Topic: development release newLISP v.9.3.4
Replies: 7
Views: 3246

Lutz wrote:development release newLISP v.9.3.4
• a quicker way to make dictionaries (hashes)
hsmyers wrote:And just when I've convereted everything to assox!
Me too ;)
I'm going to investigate a little these hash tables in the NewLisp way :)
by newBert
Sat Mar 15, 2008 9:29 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

Re: I do not quite understand

I do not quite understand, though: how can one compare a dialect of lisp, written on top of JVM, and allowing easy importation of Java libraries into the lisp code/framework --- and a dialect of lisp, written in C and allowing a very simple importation from any libraries in C ?!! It was just about ...
by newBert
Sat Mar 15, 2008 4:00 pm
Forum: Anything else we might add?
Topic: Named parameters
Replies: 16
Views: 8417

And even better :

Code: Select all

(define (func)
  (letn (lst (args)
          a  (or (lookup 'a lst) 10)
          b  (or (lookup 'b lst) 10)
          c  (or (lookup 'c lst) 10))
     (println "a: " a )
     (println "b: " b)
     (println "c: " c)))

(func '(b 20) '(c 40) '(a 30))
(func '(c 100))
(func)
by newBert
Sat Mar 15, 2008 12:15 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

My expectations were quite high, but there are some good things to look at ;-) I believe that for example Clojure innovates more: http://clojure.sourceforge.net/ Fanda Some Clojure/NewLISP comparisons : ;;; Clojure ;;; ;user=> (def x 5) ;user=> (def lst '(a b c)) ;user=> `(fred x ~x lst ~@lst 7 8 :...
by newBert
Sat Mar 15, 2008 11:04 am
Forum: Anything else we might add?
Topic: Named parameters
Replies: 16
Views: 8417

Another solution with default arguments : (define (func) (letn (lst (if (args) (first (args))) a (or (lookup 'a lst) 10) b (or (lookup 'b lst) 10) c (or (lookup 'c lst) 10)) (println "a: " a ) (println "b: " b) (println "c: " c))) (func '((b 20) (c 40) (a 30))) (func '((c 100))) (func) output: a: 30...
by newBert
Sun Mar 02, 2008 5:29 pm
Forum: Anything else we might add?
Topic: Streams in newLISP
Replies: 38
Views: 22470

xytroxon wrote:That makes it official, iteration IS the CORRECT way to do it! ;) LOL
... and what about the newLISP way? LOL again
;)
by newBert
Sun Mar 02, 2008 4:51 pm
Forum: Anything else we might add?
Topic: Streams in newLISP
Replies: 38
Views: 22470

P.S.: that's why I'm still hesitant between Scheme and newLISP (with a slight preference for newLISP ... ) Why hesitant? Enjoy both! Say NO to software monogamy. I agree ... but I have to take into account the limitations of my machine :D I already have installed many Logo(s), including Elica and a...
by newBert
Sun Mar 02, 2008 4:17 pm
Forum: Anything else we might add?
Topic: Named parameters
Replies: 16
Views: 8417

this one avoids the extra pair of parenthesis and quote: (define-macro (foo) (local (len width height) (bind (args)) (println "len:" len " width:" width " height:" height) )) > (foo (width 20) (height 30) (len 10)) len:10 width:20 height:30 ps: or use (apply set (flat (args))) instead of (bind (arg...
by newBert
Sun Mar 02, 2008 9:59 am
Forum: Anything else we might add?
Topic: Streams in newLISP
Replies: 38
Views: 22470

It's just that I was translating Scheme code (which supports tail-call recursion) to newLISP. That's what I do most of the time ;) Tail-call recursion is just as fast as iteration (because they're pretty much the same thing, no?) Personally, I prefer 'tail-call recursion' that I find more intuitive...
by newBert
Sat Mar 01, 2008 7:10 pm
Forum: Anything else we might add?
Topic: Streams in newLISP
Replies: 38
Views: 22470

Elica wrote:
itistoday wrote:...without tail-call recursion unfortunately.
What about iteration? It does not gulp down the stack...
This reminds me a passage from "Code Patterns in newLISP": Recursion or iteration?

In any case we can get through!
;)
by newBert
Sat Mar 01, 2008 2:54 pm
Forum: Anything else we might add?
Topic: Streams in newLISP
Replies: 38
Views: 22470

Re: Streams in newLISP

Hm! You say it crashes because of the stack! Are there tail-calls in newLisp? They will resolve all problems with recursion if tail-recursion is used (when possible). No tail-recursion optimization in NewLISP, as in many Lisp moreover (except OpenLisp, I believe, and probably some others). I miss t...
by newBert
Thu Feb 28, 2008 4:55 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

the following creates memoizing functions from any function and arbitrary number of arguments: (define-macro (memoize func mem-func) (set (sym mem-func mem-func) (letex (f func m (sym "mem" mem-func)) (lambda () (or (and m (lookup (args) m)) (last (push (list (args) (apply f (args))) m))))))) Lutz ...
by newBert
Wed Feb 27, 2008 1:33 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

Fine, we can really play with NewLISP as we would play with Scheme (or Lisp), but with more facilities. Things and concepts become clearer with NewLISP.
;)
by newBert
Mon Feb 25, 2008 6:00 pm
Forum: newLISP Graphics & Sound
Topic: Controlling canvas size
Replies: 6
Views: 6116

newBert wrote:Sorry, I am still not quite at ease with 'grid-layout' ;)
P.S.: but if you find a solution for your problem, it interests me :)
by newBert
Sun Feb 24, 2008 2:43 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

I have also tried other things : ;; NewLISP (define x 1) (define (f) x) (f) ; => 1 (define (g x) (f)) (g 0) ; => 0 ;; SCHEME (define x 1) (define (f) x) (f) ; => 1 (define (g x) (f)) (g 0) ; => 1 I can't get equivalent results in Scheme and in NewLisp, due to different scoping, and 'letex' is of no...
by newBert
Sun Feb 24, 2008 10:24 am
Forum: newLISP newS
Topic: Newlisp Coded in Java?
Replies: 3
Views: 2245

For a Lisp written in Java, you can see Fanda's post :
Fanda wrote:My expectations were quite high, but there are some good things to look at ;-)

I believe that for example Clojure innovates more:
http://clojure.sourceforge.net/

Fanda
in this topic.
by newBert
Sun Feb 24, 2008 10:12 am
Forum: newLISP Graphics & Sound
Topic: Controlling canvas size
Replies: 6
Views: 6116

Sorry, I am still not quite at ease with 'grid-layout' ;)
by newBert
Sat Feb 23, 2008 7:10 pm
Forum: newLISP Graphics & Sound
Topic: Controlling canvas size
Replies: 6
Views: 6116

Is it not possible with gs:set-size ? gs:set-size syntax : (gs:set-size sym-id int-width int-height) parameter : sym-id - The name of the component of which a preferred size is set. parameter : int-width - The preferred width of the component. parameter : int-height - The preferred height of the com...
by newBert
Fri Feb 22, 2008 10:10 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

Thank you all for your answers, I can use them as arguments in discussions about this topic (scoping, etc.) without appearing too ignorant ... ;) In fact, although it does not use static scoping by default,NewLisp can still implement (functional) object-oriented programming which is easier to use an...
by newBert
Fri Feb 22, 2008 7:05 pm
Forum: Anything else we might add?
Topic: Another newLISP-like language :)
Replies: 49
Views: 34158

And what about CloJure ? I think it is a competitor to newLisp far more daunting than Arc ... among other things, because of its lexical scoping (by default). This issue of "dynamic vs. static scoping" concerned me a lot these days, probably because I finally realized what it was ;) ... and I tried ...
by newBert
Fri Feb 01, 2008 2:35 pm
Forum: newLISP newS
Topic: release newLISP version 9.3
Replies: 8
Views: 3870

Among other good things, when is really wellcome, for the compatibility with some Scheme scripts of mine...

Thanks

I think I'm going to abandon definitely Scheme ;)