Search found 608 matches

by TedWalther
Sun Jul 24, 2016 7:45 am
Forum: So, what can you actually DO with newLISP?
Topic: concurrent design for check
Replies: 5
Views: 6691

Re: concurrent design for check

What do you mean by "functional". Goroutines? channels? slots? shared memory? As in functional programming -- procedures that act like mathematical functions in that they only operate on their arguments and don't side-effect. Wow, Ted, as long as I've been talking about FP in this forum, I'm surpri...
by TedWalther
Sat Jul 23, 2016 7:36 pm
Forum: So, what can you actually DO with newLISP?
Topic: concurrent design for check
Replies: 5
Views: 6691

Re: concurrent design for check

What do you mean by "functional". Goroutines? channels? slots? shared memory? NewLISP has built in "send" and "receive" functions... maybe that does with ssqq wants?
by TedWalther
Thu Jul 21, 2016 6:30 pm
Forum: Anything else we might add?
Topic: primitive function empty? could not accept array
Replies: 13
Views: 12766

Re: primitive function empty? could not accept array

Since you can convert an array into a list, it is easy to overlook that there is no "list to array" function. But array creation does let you use a list as an "initializer". '() is a list... intuitively, until you try and fail, you wouldn't guess that the empty list isn't allowed as an array initial...
by TedWalther
Thu Jul 21, 2016 4:43 am
Forum: Anything else we might add?
Topic: primitive function empty? could not accept array
Replies: 13
Views: 12766

Re: primitive function empty? could not accept array

By default, we perceive an array as a special case of a list; so we expect it to act like a like in pretty much every way. So, even if an array is never empty, it makes sense for every function that acts on a list, to also act on an array and do the sensible thing. Even though under the hood, an arr...
by TedWalther
Fri Jul 15, 2016 8:12 pm
Forum: Anything else we might add?
Topic: How to make destructive function
Replies: 2
Views: 4779

Re: How to make destructive function

I suggest, use a macro, or else pass in a symbol, you can alter the value that a symbol points to.
by TedWalther
Fri Jul 08, 2016 8:09 am
Forum: Anything else we might add?
Topic: functor name error [a..e]
Replies: 2
Views: 4892

Re: functor name error [a..e]

Try (define (a:a)) instead of (define a:a) if you want to define the default functor; the functor is a function. If you truly want to define a:a (not the default functor), then... yes, what is the right result. By the way, I get this result: newLISP v.10.6.2 64-bit on Linux IPv4/6 UTF-8 libffi, opti...
by TedWalther
Thu Jul 07, 2016 9:18 am
Forum: Anything else we might add?
Topic: Strange reader
Replies: 5
Views: 10826

Re: Strange reader

This didn't work either, surprised me: > (define λ fn) ERR: invalid lambda expression : " fn)" > (define λ 'fn) ERR: invalid lambda expression : "fn)" > (set 'λ 'fn) ERR: invalid lambda expression : "fn)" > (constant 'λ 'fn) ERR: invalid lambda expression : "fn)" > (constant 'λ fn) ERR: invalid lamb...
by TedWalther
Thu May 05, 2016 7:13 pm
Forum: newLISP newS
Topic: sqlite3 module: how to maintain lib paths
Replies: 10
Views: 18075

Re: sqlite3 module: how to maintain lib paths

I'm thinking we need something like a context "librarypath" set by the system init file. And for each library to be imported, you can lookup its symbol name. That way each distribution that packages newlisp (Debian, BSD, etc) can tune the library path for its system, without messing with the module ...
by TedWalther
Tue Apr 26, 2016 2:44 am
Forum: So, what can you actually DO with newLISP?
Topic: Quaternion strikes back
Replies: 4
Views: 9528

Re: Quaternion strikes back

Can you put this on github so it is easier to review your code changes?
by TedWalther
Mon Apr 25, 2016 8:00 am
Forum: Anything else we might add?
Topic: min-max limiter
Replies: 2
Views: 8850

Re: min-max limiter

Code: Select all

(cond ((> x some_max) x_max) ((< x some_min) x_min) (true x))
If you use this idiom enough, you may want to wrap it into a function, call it "bandpass".

Code: Select all

(define (bandpass x xmin xmax)
    (cond ((> x xmax) xmax) ((< x xmin) xmin) (true x)))
by TedWalther
Thu Apr 07, 2016 3:32 am
Forum: newLISP and the O.S.
Topic: newlisp builds with libffi on OpenBSD 5.9
Replies: 1
Views: 4413

Re: newlisp builds with libffi on OpenBSD 5.9

Thank you, I'll submit a patch to them soon.
by TedWalther
Mon Apr 04, 2016 8:36 pm
Forum: So, what can you actually DO with newLISP?
Topic: Quaternion Calculus
Replies: 5
Views: 6956

Re: Quaternion Calculus

Very nice.
by TedWalther
Sat Apr 02, 2016 5:45 pm
Forum: newLISP newS
Topic: newLISP Development Release v.10.5.6
Replies: 9
Views: 14398

Re: newLISP Development Release v.10.5.6

Have you checked if libffi support is enabled? I know a while ago they updated libffi to one that works with newLisp. I haven't had time or energy to update my OpenBSD build server, so I haven't been able to test this.
by TedWalther
Mon Mar 28, 2016 7:55 pm
Forum: newLISP and the O.S.
Topic: newLisp won't compile
Replies: 1
Views: 4683

Re: newLisp won't compile

Have you installed libffi-dev?

Code: Select all

sudo apt install libffi-dev
by TedWalther
Wed Feb 10, 2016 9:42 am
Forum: So, what can you actually DO with newLISP?
Topic: un-declare symbols check tool for newLISP
Replies: 1
Views: 4957

Re: un-declare symbols check tool for newLISP

Very nice. Any further development on it? I really could have used this last summer, but my brain overlooked your post. Sorry.
by TedWalther
Thu Jan 07, 2016 5:16 am
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

joejoe wrote:Am I on a good line of thinking to have a user/pass/cookie allow private schedules to display?
Yes, as long as the cookie lets you know who the user is, and you are using SSL (https). SSL will mitigate from people snooping the connection and copying the cookie.
by TedWalther
Wed Jan 06, 2016 8:41 am
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

Then do this: (define (schedule:get sched usr) (let (s (schedule sched)) (if s (if (or (= usr (s 0)) (= 'public (s 1))) s 'access_denied) 'not_found))) Once you confirm that works, you can add more code on your own to verify that the user is valid before returning a schedule. Just have a separate co...
by TedWalther
Sat Jan 02, 2016 10:27 pm
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

So your data model is like this: Every schedule is unique, will have a unique name or key. Every schedule will have a creator/owner. Every schedule will be either public or private. Then I propose that the schedules format is like this: ;; (schedule "schedule1" "owner1" 'public 1 2 3 4 ...) Thing is...
by TedWalther
Thu Dec 31, 2015 5:16 am
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

Too vague. How would "other" users access a users schedule? What would they do with it? (define user-schedules:user-schedules) (define (user-schedules:add u s) (let (nu (sym (string "_" u))) (if (eval nu) (push s (eval nu) -1) (set nu (list s))) ) ) (user-schedules:add "user1" "schedule1") (define s...
by TedWalther
Thu Dec 31, 2015 3:46 am
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

You're welcome JoeJoe. What I'm doing is using the red-black tree implementation, or "contexts as dictionaries". This is a common idiom in newlisp, very fast and easy. So the question is, is a schedule unique. What do you mean by "allow another user to access the schedule". Does a schedule always be...
by TedWalther
Mon Dec 28, 2015 7:32 am
Forum: newLISP in the real world
Topic: scaling list addressing
Replies: 12
Views: 9669

Re: scaling list addressing

I would do it like this: (define schedules:schedules) (define (schedules:add u) (let (s (sym (string "_" u))) (if (eval s) (push (args) (eval s) -1) (set (sym (string "_" u)) (list (args)))))) (schedules:add "user1" "Feed plants" 1450754544 604800 1456197744) (schedules:add "user1" "Manicure plants"...
by TedWalther
Mon Dec 21, 2015 10:34 pm
Forum: newLISP in the real world
Topic: [BoF] error after deleting var ctx part of dyn sym
Replies: 7
Views: 7832

Re: [BoF] error after deleting var ctx part of dyn sym

Yes, I like the fully dynamic nature of newLisp. But, this summer, I ran into a lot of problems in coding with a team, because it was a big mystery where things were being defined. And using symbols that were expected to be defined but weren't, caused big headaches. The bug could cascade and cause e...
by TedWalther
Mon Dec 21, 2015 4:34 am
Forum: newLISP in the real world
Topic: [BoF] error after deleting var ctx part of dyn sym
Replies: 7
Views: 7832

Re: [BoF] error after deleting var ctx part of dyn sym

I sometimes wish "referring" to a unknown symbol wasn't the same thing as "defining" it. perhaps if all symbols were stuck into the "undefined" context until they were properly defined by "set" or "define". Perhaps instead of "global" being a property of a symbol, global symbols would be moved to th...
by TedWalther
Sun Dec 06, 2015 3:10 am
Forum: newLISP in the real world
Topic: Closing stdin for sub process
Replies: 6
Views: 7719

Re: Closing stdin for sub process

I finally made it work using (wait-pid -1 nil), the non-blocking version of waitpid. Still, I'm puzzled that when process exits, the file descriptors aren't closed off and I don't get EOF when I'm finished reading from a dead process. Even when I do the waitpid so the process is reaped, the file han...
by TedWalther
Sat Dec 05, 2015 12:13 pm
Forum: newLISP in the real world
Topic: exec function not returning string list
Replies: 2
Views: 4862

exec function not returning string list

Since I've had problems with (process), I tried to use (exec) instead. When I read the documentation I was very happy; it does exactly what I need. (exec "command") => string-list With (exec), I would run the command, and it would return the output of the command as a list of strings. Ok, that is al...