Search found 95 matches
- Thu Aug 27, 2009 2:35 am
- Forum: Whither newLISP?
- Topic: Is a lisp with only functional parentheses possible?
- Replies: 33
- Views: 19266
Here are a couple of ideas you might try to reduce parentheses: 1. Give function names a special form such as all caps so that your translator can easily find them and have the function names double up as the left parenthesis. 2. Let the square brackets [ and ] act as a replacement for double parent...
- Sat Jun 20, 2009 8:30 pm
- Forum: Whither newLISP?
- Topic: What is the language of the future?
- Replies: 13
- Views: 8197
Ah, IMHO programming languages will die within the span of a human life. What I actually mean is that in the future people would communicate with machines (this includes "programming") in a non-verbal and non-language approach. I don't know the details yes (ha-ha!) but it could be something like di...
- Wed Jun 17, 2009 2:46 am
- Forum: Whither newLISP?
- Topic: What is the language of the future?
- Replies: 13
- Views: 8197
And what do you think about these issues, Jeremy? Well, I am not sure about Unixtechie's belief in using the principles of "natural" language. In natural language we do not make use of parentheses and cannot nest expressions more than a couple levels without getting lost. Larry Walll tried to use l...
- Sat Jun 13, 2009 6:24 pm
- Forum: Whither newLISP?
- Topic: What is the language of the future?
- Replies: 13
- Views: 8197
What is the language of the future?
This post is simply my amateur musings about the future of programming and asking your thoughts. One of things I was hoping would improve would be that the environment would allow you to write code in any language that you wanted so that usefullness would determine what languages would be used. Ever...
- Tue Mar 03, 2009 2:21 am
- Forum: Whither newLISP?
- Topic: Handy looping function
- Replies: 3
- Views: 3378
Handy looping function
First the code: (define (dolist-choice n A B C) (if (list? n) (setq n (dec (length n)))) (eval (if C (if (zero? $idx) A (= $idx n) B C) (if (member $idx '(0 n)) A B) ) ) ) This is a special branching function designed for being used within a DOLIST loop. The function can take up to 4 arguments. The ...
- Wed Feb 25, 2009 3:11 am
- Forum: newLISP newS
- Topic: Add and Mul
- Replies: 2
- Views: 2731
Kaz, you're so quick on the draw! Thanks for the fast typing. Yes, I agree that overloading can get crazy sometimes but it is nice to have common operations that are very closely related under one roof. In multiplication for instance, factorials, product of elements of vector all share a commonality...
- Tue Feb 24, 2009 3:43 am
- Forum: newLISP newS
- Topic: Add and Mul
- Replies: 2
- Views: 2731
Add and Mul
Some possible enhancements to add and mul: ADD When supplied with a single vector return the sum of all of the elements (add (1 2 3 4)) -> 10 When supplied with an integer and T return the continued sum of the digits of the integer. (add 7898 T) -> 7+8+9+8 = 32 3+2 = 5 MUL When supplied with a singl...
- Fri Feb 06, 2009 7:51 pm
- Forum: newLISP newS
- Topic: dup
- Replies: 2
- Views: 2519
dup
Lutz,
Why not make DUP take additional multiplier arguments so that
(dup x n1 n2 n3 ....) is the same as (dup (dup (dup x n1) n2) n2)? That way if I want a 3x3 matrix of zeros I can write (dup 0 3 3) instead of (dup (dup 0 3) 3).
Why not make DUP take additional multiplier arguments so that
(dup x n1 n2 n3 ....) is the same as (dup (dup (dup x n1) n2) n2)? That way if I want a 3x3 matrix of zeros I can write (dup 0 3 3) instead of (dup (dup 0 3) 3).
- Wed Dec 31, 2008 7:52 pm
- Forum: newLISP newS
- Topic: release newLISP version 10.0
- Replies: 26
- Views: 13112
- Wed Dec 24, 2008 9:08 pm
- Forum: Anything else we might add?
- Topic: replace regular expressions
- Replies: 10
- Views: 9126
Corm, I like what you posted because it is along the lines of what I was trying to do only developed further. There was also this approach that was posted on the Arc forum that deserves looking at too. http://www.lisperati.com/arc/regex.html One of the criticisms that I have of what you posted is th...
- Sun Dec 21, 2008 6:19 pm
- Forum: Anything else we might add?
- Topic: Folding and Such
- Replies: 1
- Views: 2528
Folding and Such
In our code snippets is a little function for doing alternating addition and subtraction that enables you to write an expression like a+b-c+d.. as (+- a b c d ...) which is just a shorthand for (+ (- (+ a b) c) d). One immediately thinks about generalizing this for any two functions A and B to get (...
- Wed Jul 30, 2008 12:59 am
- Forum: newLISP newS
- Topic: $idx
- Replies: 0
- Views: 1994
$idx
Now that $idx has been added to all looping structures could it be useful to also have two more? I wanted to suggest having two more locals named $prev and $next that would be defined as $prev = $idx - 1 $next = $idx + 1 Often in loops it is the previous or next element that I am interested in also,...
- Fri Jul 25, 2008 5:52 pm
- Forum: Anything else we might add?
- Topic: Cyclic Permutation
- Replies: 2
- Views: 3219
Cyclic Permutation
Greetings all lispers! I have run across a situation that I am sure some of you have too where one has an expression that involves the repetition of a form that has a cyclic permutation of arguments. For instance, suppose we have (add (mul (sin A)(sin B))(mul (sin B)(sin C))(mul (sin C)(sin A))) It ...
- Fri Jul 18, 2008 7:17 pm
- Forum: Anything else we might add?
- Topic: Unless
- Replies: 22
- Views: 10976
- Tue Feb 26, 2008 3:29 am
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
Elica, I don't know that I am breaking the LISP syntax at all unless you want to narrow it down. I have a function name "nest" that is followed by arguments and is enclosed in parentheses, I believe that is LISP syntax. The fact that I treat the argument : in a special manner may be unlispy to some ...
- Tue Feb 26, 2008 3:18 am
- Forum: Anything else we might add?
- Topic: Another handy dandy conditional
- Replies: 1
- Views: 2448
Another handy dandy conditional
Here is a conditional form that I find very useful (define (<=> x y body1 body2 body3) (if (list? x)(setq x (length x))) (if (list? y)(setq y (length y))) (eval (if (< x y) body1 (= x y) body2 body3 ))) This is a conditional with three bodies. X and Y can either be a list or a number. If X or Y is a...
- Sun Feb 24, 2008 10:44 pm
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
Further fooling around made me realize I forgot to localize my variables, this I hope will be the final word: (define-macro (nest) (local (ind funcs vars start) (if (setq ind (find : (map eval (args)))) (begin (setq funcs (slice (args) 0 ind) vars (slice (args)(+ ind 1)) start (eval (append (list (l...
- Tue Feb 05, 2008 3:23 am
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
- Sun Feb 03, 2008 11:24 pm
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
Here is yet another way that one might do it where I used the function name N for NESTING rather than NOT. (define-macro (n) (setq funcs (filter (fn (x)(ends-with x "&")) (map rest (map string (map quote (filter symbol? (args)))))) start (eval (slice (args)(length funcs))) ) (dolist (op (reverse fun...
- Sat Feb 02, 2008 3:09 am
- Forum: Anything else we might add?
- Topic: Useful higher order function for booleans
- Replies: 0
- Views: 2560
Useful higher order function for booleans
I love it when I find something simple and useful. One of the things we notice with boolean functions is that they invariably are inside an If...then... expression. Now sometimes we want the truth value of the statement but many times we are only using it to decide whether we are going to use the ar...
- Fri Feb 01, 2008 2:45 am
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
I can appreciate Fanda's criticism but I am only talking about the case where we are considering functions that take ONE argument only. Now Fanda says that something like (sin abs ceil x) becomes confusing because it all runs together. One way to handle this is simply to capitalize all functions tha...
- Thu Jan 31, 2008 2:40 am
- Forum: Anything else we might add?
- Topic: Redefine DEFINE?
- Replies: 17
- Views: 10466
Redefine DEFINE?
I wanted to revisit the subject of nested expressions, particularly functions that take a single argument only. For example, we could have (sin (abs (ceil x))) Fanda wrote a wonderful function he called PASS that enabled us to write this as (pass (sin abs ceil) x) That's pretty good but could we do ...
- Sat Jan 12, 2008 10:59 pm
- Forum: Anything else we might add?
- Topic: Suggestions for DOLIST
- Replies: 3
- Views: 3712
Suggestions for DOLIST
In thinking about the DOLIST command I had some ideas that might be useful. The protected symbol $idx stores the current loop index. I would suggest having two more protected symbols that would be called $length and $last. $length stores the length of the list and $last stores the last index or $len...
- Sat Dec 29, 2007 6:31 pm
- Forum: Anything else we might add?
- Topic: The logic of (newLisp) list indexing
- Replies: 14
- Views: 8069
Just to raise a further can of worms, why should indexing begin with 0 in the positive direction and -1 in the negative? Wouldn't it be more proper to have 1,-1 or 0,-0 to be consistent? About the only thing I like about the VB language is that it gives you the option to set your indexing to 0 or 1 ...
- Tue Dec 25, 2007 6:48 pm
- Forum: newLISP newS
- Topic: development release newLISP v.9.2.11
- Replies: 1
- Views: 1602
Suggestion for a function enhancement. The example in the documentation for the APPLY function shows that (apply op '(1 2 3 4 5) 2) is the same as (op (op (op (op 1 2) 3) 4) 5) Could we enhance this to take lists of function names so that (apply '(op2 op1) '(1 2 3 4 5) 2) is the same as (op2 (op1 (o...