Search found 607 matches

by rickyboy
Tue Mar 05, 2019 3:44 pm
Forum: newLISP in the real world
Topic: let and letn
Replies: 4
Views: 3934

Re: let and letn

I think newBert just had a polluted outer environment. newBert, try running that code with a freshly started newlisp.
by rickyboy
Mon Jan 28, 2019 12:32 am
Forum: newLISP in the real world
Topic: csv to assoc-list
Replies: 9
Views: 6814

Re: csv to assoc-list

And finally when I need the assoc list into symbols: (map (fn (x) (set(sym(first x))(last x)))assoclst) HPW, With the above, you caused me to have a crazy thought. Make a macro that does `let`-type bindings for you, given an assoc list; then, you could write any code under that `let` to do more com...
by rickyboy
Sat Jan 26, 2019 6:58 am
Forum: newLISP in the real world
Topic: csv to assoc-list
Replies: 9
Views: 6814

Re: csv to assoc-list

HPW, just use fdb’s code but remove the outer call to flat. That will get you what you want, i.e., “rows”.
by rickyboy
Sun Dec 09, 2018 6:19 pm
Forum: newLISP in the real world
Topic: abbreviation of arguments in function
Replies: 4
Views: 3487

Re: abbreviation of arguments in function

This is the perfect case for a doc string or a comment.

Code: Select all

(define (f rate)
  “Given converse rate list `rate`, does ...”
  ... code using rate ...)
by rickyboy
Sun Nov 25, 2018 2:46 am
Forum: newLISP in the real world
Topic: help with a database in newlisp
Replies: 4
Views: 3954

Re: help with a database in newlisp

Here are some archived blog posts on nldb by the author. Simple database in newLISP https://newlisper.wordpress.com/2009/01/30/simple-database-in-newlisp-2/ Simple database, second attempt https://newlisper.wordpress.com/2009/01/30/simple-database-second-attempt/ Updates to nldb https://newlisper.wo...
by rickyboy
Sat Nov 17, 2018 11:58 pm
Forum: newLISP in the real world
Topic: Apply error message
Replies: 4
Views: 4176

Re: Apply error message

cameyo wrote:But is the expression wrong logically or syntactically?
Why "apply" does not receive a list?
This is what you had been looking for originally.

Code: Select all

(apply map (cons list '((a 1) (b 2) (c 3))))
by rickyboy
Tue Jan 30, 2018 9:10 pm
Forum: newLISP in the real world
Topic: httpd-conf intercept requests and answer with a function?
Replies: 6
Views: 5993

Re: httpd-conf intercept requests and answer with a function

Dragonfly web framework is written in newlisp

http://www.taoeffect.com/dragonfly-newl ... mple-site/

and has the functionality you seek (concerning routes):

http://www.taoeffect.com/dragonfly-newl ... fly_routes

Check out / steal some code! :) Happy hacking!
by rickyboy
Wed Nov 29, 2017 6:54 pm
Forum: newLISP and the O.S.
Topic: Not start on Win10
Replies: 13
Views: 12207

Re: Not start on Win10

forgot to add, also tried so java -jar guiserver.jar 64001 newlisp-edit.lsp /local/newLISPsplash.png ... still nothing I don't use guiserver ("but if I did..." :), so this is just a quick driveby: that path looks suspicious to me, namely: /local/newLISPsplash.png Check that the file exists there. I...
by rickyboy
Tue Sep 12, 2017 8:29 pm
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 13047

Re: Newlisp vs Lua

Good point. I wonder if Lutz would be willing to dual license newLISP. Then, you could have some fun on your project. :)
by rickyboy
Tue Sep 12, 2017 6:27 pm
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 13047

Re: Newlisp vs Lua

About Mind-share, Lua has licensed a bit differently in a way that allows proprietary software. Good point. I always try to be mindful of what the licensing is for the tools that I use, and I consider MIT/BSD/ISC and the like to be superior (namely, more free) than any GPL. Good job, Lua donks! htt...
by rickyboy
Mon Aug 07, 2017 12:57 pm
Forum: newLISP and the O.S.
Topic: unusual (print buffering on FreeBSD
Replies: 4
Views: 5867

Re: unusual (print buffering on FreeBSD

Try using `write` with the length argument, as it seems to be non-buffering in this case. $ diff -u test.lsp test-new.lsp --- test.lsp Mon Aug 7 08:51:48 2017 +++ test-new.lsp Mon Aug 7 08:53:45 2017 @@ -20,18 +20,20 @@ (sleep 5000) ; pause for effect (println "then exit") (fake-exit) ) + +(define (...
by rickyboy
Thu Aug 03, 2017 4:03 am
Forum: newLISP in the real world
Topic: [solved] String interpolation
Replies: 8
Views: 6376

Re: [solved] String interpolation

I'm playing with newlisp http server and I wanted to use such a function in my html view templates, this is why function prints by default. Now it looks cleaner for me than println/string combinations. <% (dolist (m lst) (p {<div class="member"><b>:m:</b></div>})) %> Ah, I see what you are doing. Y...
by rickyboy
Tue Aug 01, 2017 6:14 pm
Forum: newLISP in the real world
Topic: [solved] String interpolation
Replies: 8
Views: 6376

Re: [solved] String interpolation

Hi vetelko! Looks good! You didn't leave us much to work with / optimize. :) I only have one comment, with doesn't really apply here because you are giving a short, illustrative example. However, in production code, I find it useful to separate the "printing code" from the "(answer) building code". ...
by rickyboy
Tue May 02, 2017 10:19 pm
Forum: newLISP in the real world
Topic: Created an include script
Replies: 4
Views: 6291

Re: Created an include script

hotcore, nice job! This is a very useful script. I haven't tested it but I enjoyed reading it. If I could offer anything, it would be small changes, not design-level changes. For instance, I'd make the end of function nlinc look like this: ... (while extra-pass (setq extra-pass (pass wf1 wf2)) (swap...
by rickyboy
Tue May 02, 2017 9:41 pm
Forum: newLISP in the real world
Topic: Created an include script
Replies: 4
Views: 6291

Re: Created an include script

Hello. Your system works if i load an extranal .lsp that loads an external .lsp too? in a chain of a script that load another script that load another script, i mean ... Yes. Reviewing the author's (hotcore's) code reveals 'include's are effectively recursive. Hence, you should try the script for y...
by rickyboy
Tue May 02, 2017 3:08 pm
Forum: newLISP in the real world
Topic: Building executable, without external lsp?
Replies: 3
Views: 3502

Re: Building executable, without external lsp?

Ah, I see you're question. (It has something to do with the other post on this same board today. (Maybe.)) Scenario is that, e.g., A.lsp loads B.lsp, but you make an executable from A.lsp only, right? In that case, perform an inclusion process as the author of the other post did. You don't have to u...
by rickyboy
Fri Aug 05, 2016 12:56 pm
Forum: newLISP in the real world
Topic: memory leak? antiprimes
Replies: 15
Views: 9741

Re: memory leak? antiprimes

Although, that is a "surprise". I expect dolist to return a list, then suddenly it doesn't. :) The manual says: "The return value of dolist is the result of the last evaluated expression." http://www.newlisp.org/downloads/newlisp_manual.html#dolist The other looping constructs, and such as `when`, ...
by rickyboy
Fri Aug 05, 2016 12:45 pm
Forum: newLISP in the real world
Topic: How to add stack size when -x code to executable file
Replies: 2
Views: 4046

Re: How to add stack size when -x code to executable file

Hmmm. I've never done this. But before you try anything with linking, first confirm that adding more stack space will solve your issue. $ newlisp -s 10000 foo.lsp If something like the above works (for the appropriate value of -s, of course), only then proceed to the following I assume you are linki...
by rickyboy
Fri Aug 05, 2016 12:26 pm
Forum: newLISP in the real world
Topic: dangrous true?
Replies: 1
Views: 3621

Re: dangrous true?

ssqq wrote:if you use true? as checking function for list, be attention to: blank list -> '(), would not match it.

Code: Select all


> (true? '())
nil
`true?` works as advertised.

http://www.newlisp.org/downloads/newlis ... html#truep

I don't see any problem with it, and so I don't consider it "dangerous".
by rickyboy
Fri Aug 05, 2016 12:16 pm
Forum: newLISP in the real world
Topic: How to avoid stack overflow
Replies: 1
Views: 3633

Re: How to avoid stack overflow

I don't know how resume stack space in newLISP. If I use one function do too much thiings, then the stack of function may occur stack overflow? If i reject the return value when call other function, then would avoid stack overflow? If anyone could give me some advise? I don't understand what you ar...
by rickyboy
Fri Aug 05, 2016 12:08 pm
Forum: newLISP in the real world
Topic: intersect bug?
Replies: 4
Views: 5781

Re: intersect bug?

If you want intersect more list: > (set '@lst '((1 2 3 4) (2 3 4 5) (3 4 5 6) (4 5 6 7))) ((1 2 3 4) (2 3 4 5) (3 4 5 6) (4 5 6 7)) > (map (curry apply intersect) (explode @lst 2)) ((2 3 4) (4 5 6)) > (apply intersect (map (curry apply intersect) (explode @lst 2))) (4) Or more simply: > (set '@lst ...
by rickyboy
Thu Aug 04, 2016 1:49 am
Forum: newLISP in the real world
Topic: memory leak? antiprimes
Replies: 15
Views: 9741

Re: memory leak? antiprimes

Hi Ted! Actually, there is a way to make your program even faster -- a lot faster. The idea is that there is a way to determine the number of divisors of a (natural) number which is a lot cheaper than computing the unique sub-groupings of its prime factors. Here is a routine that does just that. (de...
by rickyboy
Tue Aug 02, 2016 12:22 pm
Forum: Anything else we might add?
Topic: -nan is not number
Replies: 4
Views: 6020

Re: -nan is not number

Hello ssqq, This is what you need: http://www.newlisp.org/downloads/newlisp_manual.html#NaNp . As a backgrounder, the committee who put together the floating point standard had a reason for admitting things like NaN as floating point "values". Technically they are "numbers" (FP values, really). http...
by rickyboy
Tue Jul 26, 2016 9:56 pm
Forum: Whither newLISP?
Topic: mat BUG
Replies: 2
Views: 7820

Re: mat BUG

Here too. $ uname -srm OpenBSD 6.0 amd64 $ newlisp -v newLISP v.10.7.0 64-bit on BSD IPv4/6 UTF-8. $ newlisp -e "(mat * '((1 2 3) (4 5 6)) -1)" ((1.844674407370955e+19 3.68934881474191e+19 5.534023222112865e+19) (7.378697629483821e+19 9.223372036854776e+19 1.106804644422573e+20)) Thanks, kosh, for f...