Search found 608 matches

by TedWalther
Sat Sep 12, 2020 8:54 pm
Forum: newLISP in the real world
Topic: get-url works on some sites
Replies: 4
Views: 540

Re: get-url works on some sites

I've been updating the curl module; guess I'll have to send it in soon. I got it working to a point it could log in to some forums and do some backups. The forum is long gone so I'll have to double check again to see if there is any bit-rot.
by TedWalther
Sat Sep 12, 2020 12:33 am
Forum: newLISP in the real world
Topic: get-url works on some sites
Replies: 4
Views: 540

Re: get-url works on some sites

At a guess, those websites that don't work, they probably are doing a "redirect" to the https ssl/tls version of the page, and get-url doesn't do ssl/tls at this time. To make it work, newlisp would have to drag in an entire ssl library, which could raise the size of the binary considerably. gambit ...
by TedWalther
Sat Jul 25, 2020 10:42 pm
Forum: Whither newLISP?
Topic: where is the value which is assigned by setq to a symbol?
Replies: 4
Views: 865

Re: where is the value which is assigned by setq to a symbol?

Whereever it is stored, if anywhere, it is immediately deleted on returning from setq. Why? Because 'f is the same as (quote f) And setting a value to a quote cell doesn't bind it to a symbol... so the ORO memory manager (should) just toss it.
by TedWalther
Thu Jun 06, 2019 4:21 pm
Forum: Anything else we might add?
Topic: case design
Replies: 2
Views: 3408

Re: case design

case doesn't evaluate the conditions. So if you call check-type 1, it compares Type to 1, and of course they aren't the same. If you called (check-type 'Type) it would work. Or if you changed the condition to (case x (1 (println "the type is Type"))) it would work. As for the "why"? I don't know. Pe...
by TedWalther
Mon Jun 03, 2019 8:17 pm
Forum: newLISP in the real world
Topic: Sum of digits
Replies: 4
Views: 1245

Re: Sum of digits

(define (digital_root n) (+ 1 (% (- n 1) 9)) > (digital_root 236753647864) 7 I heard this referred to as Raman's forumula, but not sure if that is the proper name for it. Even Wolfram's website didn't give an origin for it that I could find. It works though. I tested it on the numbers from 0 to 100...
by TedWalther
Fri Jan 04, 2019 12:44 am
Forum: newLISP newS
Topic: Ask info about newLISP
Replies: 6
Views: 2978

Re: Ask info about newLISP

One thing on the TODO list: non-blocking sockets, which would allow internet services to be more reliable and avoid a race condition when doing things the traditional way using net-select/accept on sockets that are bound and listening for incoming connections. Haven't had time to do it myself.
by TedWalther
Mon Dec 10, 2018 5:02 am
Forum: newLISP in the real world
Topic: nonblocking read-key
Replies: 0
Views: 1746

nonblocking read-key

I'm glad for the new non-blocking option for read-key (read-key true).

Lutz, is it intentional that (read-key true) returns 0 instead of nil when there is no keypress to report?
by TedWalther
Fri Dec 07, 2018 3:15 am
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

Re: nonblocking option for net-accept?

Another quote, from here: https://jameshfisher.com/2017/04/05/set_socket_nonblocking.html If our server only makes calls which select has indicated will not block, will everything be OK? No! These two operations - select followed by the hopefully non-blocking call - are non-atomic. By the time the s...
by TedWalther
Fri Dec 07, 2018 2:21 am
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

Re: nonblocking option for net-accept?

Why does net-select not work for you? Maybe I don't understand the question. One learns something new every day. Thank you Lutz. Whether for straight read, or for accept, without setting nonblocking mode on the socket, select() isn't guaranteed to give you back a socket that will return a result ri...
by TedWalther
Fri Dec 07, 2018 1:13 am
Forum: newLISP in the real world
Topic: string evaculat in (if ...)
Replies: 2
Views: 926

Re: string evaculat in (if ...)

Your example works for me, using newlisp 10.7.4 on Ubuntu. what version of newlisp are you using?
by TedWalther
Fri Dec 07, 2018 12:42 am
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

Re: nonblocking option for net-accept?

try to work with net-listen : http://www.newlisp.org/downloads/newlisp_manual.html#net-listen Lutz, I read through that. Did I miss something? My use case is: ;; pseudocode (net-listen port "nonblocking") (set 'active-connections (list)) ;; event loop (while true (set 'newclient (net-accept)) ;; no...
by TedWalther
Thu Dec 06, 2018 4:29 am
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

Re: nonblocking option for net-accept?

I did look at prodcons.lsp in the examples directory, and it doesn't look like it can do the job, because the server won't know the semaphore value for the individual connections that come in, assuming I fork for each connection and copied the producer/consumer code.
by TedWalther
Thu Dec 06, 2018 4:17 am
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

Re: nonblocking option for net-accept?

The use case for this is I want to accept connections and keep them alive and process them in a round robin way while still accepting new connections. Otherwise it gets annoying trying to let all the different incoming connections interact with each other and a common shared state.
by TedWalther
Wed Dec 05, 2018 10:46 pm
Forum: newLISP in the real world
Topic: nonblocking option for net-accept?
Replies: 7
Views: 1613

nonblocking option for net-accept?

Lutz, can we have a non-blocking option for a listening socket, so I can accept and also handle socket session without doing a spawn/sync dance? I think net-select and net-peek already let me do what is needed to multiplex multiple connections in one process, just need a non-blocking net-accept.
by TedWalther
Sun Dec 02, 2018 1:51 am
Forum: newLISP in the real world
Topic: Help on Connect MS-SQL-Server on Linux/Ubuntu
Replies: 2
Views: 981

Re: Help on Connect MS-SQL-Server on Linux/Ubuntu

did you install the microsoft odbc package for Ubuntu as described on this webpage? https://docs.microsoft.com/en-us/sql/co ... erver-2017
by TedWalther
Sun Dec 02, 2018 1:47 am
Forum: newLISP in the real world
Topic: Help on Connect MS-SQL-Server on Linux/Ubuntu
Replies: 2
Views: 981

Re: Help on Connect MS-SQL-Server on Linux/Ubuntu

where is the modified odbc.lsp?
by TedWalther
Thu Aug 23, 2018 6:15 pm
Forum: newLISP and the O.S.
Topic: Calling OBJC runtime from newlisp
Replies: 19
Views: 10113

Re: Calling OBJC runtime from newlisp

That is so beautiful it makes me want to cry.
by TedWalther
Tue Aug 21, 2018 7:00 pm
Forum: newLISP in the real world
Topic: Writing to a C array of floats
Replies: 2
Views: 1374

Re: Writing to a C array of floats

Dexter, have you looked at the pack and unpack functions? I think they'll do what you want.
by TedWalther
Sun May 06, 2018 5:48 pm
Forum: newLISP in the real world
Topic: json-parse string expected
Replies: 2
Views: 1347

Re: json-parse string expected

Are you sure the link is spelled correctly? When I click the link, I get "page not found".
by TedWalther
Wed Apr 04, 2018 5:55 pm
Forum: newLISP and the O.S.
Topic: Encoding surrealism in WIN10: UTF-8-NEWLISP in CMD.EXE
Replies: 3
Views: 2268

Re: Encoding surrealism in WIN10: UTF-8-NEWLISP in CMD.EXE

Wow, good detective work. Thank you for that nice diagram. Do you have a program to auto-generate it from a script, or was it a hand drawn work of art? I ask because often I'd like to make similar diagrams to illustrate things.
by TedWalther
Thu Feb 08, 2018 3:04 am
Forum: newLISP in the real world
Topic: Splitting words into syllables
Replies: 2
Views: 1745

Re: Splitting words into syllables

Hi, I don't know of anything like that for newlisp, but should be easy to implement. Do you have a link to a good description of the algorithm? SInce the source of TeX is available, and the documentation comes with it, it should be in there somewhere. Can you track it down?
by TedWalther
Fri Feb 02, 2018 10:48 pm
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 5195

Re: Newlisp vs Lua

joejoe, you are fundamentally misunderstanding the issue here. Creating an application, then "compiling" it in into a standalone binary, which means the newlisp executable plus the newlisp source code tacked onto the end, doesn't alter newlisp in any way. Using the GPL here prevents distributing suc...
by TedWalther
Fri Feb 02, 2018 10:46 pm
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 5195

Re: Newlisp vs Lua

If you contributed code that your grand-kids could not make use of because your license choice allowed the boxing up and redistribution of your source code without sharing the source code to your grand-kids, that would be a loss, like not really free code (i.e., MIT/BSD). Dual-licensing allows for ...
by TedWalther
Mon Oct 09, 2017 8:12 pm
Forum: newLISP newS
Topic: Development release newLISP v.10.7.3
Replies: 7
Views: 4431

Re: Development release newLISP v.10.7.3

Wow, how did you know. This week for the first time in many years of using newlisp, I used read-key. And then I came to a use-case where I wanted non-blocking. I tried using "peek" for this, but it didn't work. Thank you for adding non-blocking read-key!
by TedWalther
Wed Sep 13, 2017 8:20 am
Forum: newLISP in the real world
Topic: Why is the behavior of "trim" function so strange?
Replies: 11
Views: 3364

Re: Why is the behavior of "trim" function so strange?

It occurs to me, if I was trimming a string, and it had \000 characters on either the left or the right side, I'd want them GONE. If it is a binary string where the \000 character belongs, then I wouldn't be running trim on it, since trim is a textual function.