Search found 228 matches
- Mon Dec 12, 2016 9:27 am
- Forum: newLISP in the real world
- Topic: generating aws signature
- Replies: 13
- Views: 9549
Re: generating aws signature
Maybe you meant to have (string ...) embeddings for the third argument to crypto:hmac calls?
- Sun Nov 06, 2016 2:33 am
- Forum: newLISP in the real world
- Topic: generating aws signature
- Replies: 13
- Views: 9549
Re: generating aws signature
Wouldn't the "hexdigest" merely be something like this?
Code: Select all
(join (map (curry format "%02x") signature-hex))
- Sun Oct 23, 2016 5:22 am
- Forum: newLISP in the real world
- Topic: generating aws signature
- Replies: 13
- Views: 9549
Re: generating aws signature
I'm pretty sure it'd be the hash_hmac step by using those two, yes, as in:
Then it needs base64-enc and url-encode and replace "%7E" with "~"...
Code: Select all
(crypto:hmac crypto:sha256 message key)
- Sun Oct 23, 2016 5:07 am
- Forum: newLISP in the real world
- Topic: generating aws signature
- Replies: 13
- Views: 9549
Re: generating aws signature
I'm no expert on AWS API, but from reading the PHP, it looks like it's a single handshake, but it relies on a prior agreement between you and Amazon about the thingies called "$publicKey" and "$privateKey". Basically it seems to be a matter of scrambling the original request with the private key, th...
- Wed Oct 19, 2016 10:43 am
- Forum: newLISP in the real world
- Topic: map trim command on list members
- Replies: 1
- Views: 3160
Re: map trim command on list members
If you try it out by hand, as in you see that the curried function is not exactly what you want.
You rather need to use a function like instead; there's no abbreviation macro for that order of arguments.
Code: Select all
> (curry trim ".")
(lambda ($x) (trim "." $x))
You rather need to use a function like
Code: Select all
(fn ($x) (trim $x "."))
- Thu Oct 06, 2016 10:00 pm
- Forum: newLISP in the real world
- Topic: bug?
- Replies: 3
- Views: 4189
Re: bug?
I'd say Bug!
Apparently ++ manages to increment nil so now the value of nil is 1.
It also appears to require a compound set of circumstances for allowing ++ increment nil, so: Well done, for finding this problem.
EDIT: Lutz was already well ahead (of course?).
Apparently ++ manages to increment nil so now the value of nil is 1.
It also appears to require a compound set of circumstances for allowing ++ increment nil, so: Well done, for finding this problem.
EDIT: Lutz was already well ahead (of course?).
- Fri Sep 16, 2016 1:15 am
- Forum: Anything else we might add?
- Topic: first or last empty list should return nil
- Replies: 1
- Views: 4284
Re: first or last empty list should return nil
My habit for those cases is to use an or clause, as in (first (or @lst '(-1))) Thus, I use a second or term to provide an appropriate sentinel construct to make the access provide whatever value I want the empty list to result in. And sometimes it works better with an if clause, as in (if @lst (firs...
- Mon Aug 08, 2016 12:57 pm
- Forum: newLISP in the real world
- Topic: send one message, but child process gets many
- Replies: 2
- Views: 3860
Re: send one message, but child process gets many
1 and 2: The printout happens in the until clause body, i.e. "until there is a message, keep printing the last received message." 10 times = 10 seconds. First one nil due to thread race.
3. I suppose it's to identify the sender; the child process could have its own children sending to it.
3. I suppose it's to identify the sender; the child process could have its own children sending to it.
- Thu Aug 04, 2016 11:30 pm
- Forum: newLISP in the real world
- Topic: intersect bug?
- Replies: 4
- Views: 5745
Re: intersect bug?
I'll bet you were thinking about that like (or similar to):
and not as which newlisp did :-)
Code: Select all
(intersect (intersect a b) (intersect c d))
Code: Select all
(intersect a b true)
- Thu Aug 04, 2016 12:19 pm
- Forum: newLISP in the real world
- Topic: memory leak? antiprimes
- Replies: 15
- Views: 9677
Re: memory leak? antiprimes
I'd say the problem comes from that dolist results in nil if the repetition list is empty. E.g. > (dolist (x '()) 1) nil Therefore you might need to wrap it into an or -clause, as in (or (dolist ....) '()) so as to ensure that the nil case translates into an empty list case, with all else the same. ...
- Sat Jul 23, 2016 2:04 am
- Forum: newLISP in the real world
- Topic: search not changing seek position
- Replies: 5
- Views: 5660
Re: search not changing seek position
Thanks. Though, there's still something funny with search , and now read-line (and seek ). E.g. $ ./newlisp newLISP v.10.7.1 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h > (open "newlisp.c" "r") 3 > (search 3 "You") 611 > (read-line 3) "You should have received a copy of the GNU General ...
- Fri Jul 22, 2016 3:35 am
- Forum: newLISP in the real world
- Topic: search not changing seek position
- Replies: 5
- Views: 5660
search not changing seek position
It seems there's something funny with mixing search and seek (or read-line ). The following is an illustration with an appropriate some-data-file.txt which has "some text" here and there. /root/newlisp-10.7.1/newlisp newLISP v.10.7.1 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h > (open "...
- Thu Jul 21, 2016 11:34 am
- Forum: Anything else we might add?
- Topic: primitive function empty? could not accept array
- Replies: 13
- Views: 12837
Re: primitive function empty? could not accept array
Again, I haven't really used arrays in newlisp, so I don't mind the lack of empty arrays once told :-) But upon review it seems that ideally the functions like find and ref (with friends) should handle arrays as if lists. Intuitively that's needed in order to take some advantage of the (as advertise...
- Mon Jul 18, 2016 10:20 pm
- Forum: Anything else we might add?
- Topic: primitive function empty? could not accept array
- Replies: 13
- Views: 12837
Re: primitive function empty? could not accept array
I'd agree that empty? should be defined for arrays. I don't use arrays much in newlisp, but in most other languages the empty array test (i.e., size==0) pops up very often.
- Thu Jun 30, 2016 6:46 am
- Forum: newLISP in the real world
- Topic: sort in v10.7.0
- Replies: 2
- Views: 4136
Re: [bug]sort in v10.7.0
The expression (sort files compare-time) is kind of dangling; at the time of execution files has no value, and the result of the sorting is not captured anyhow. Perhaps you meant to have that expression as part of the result creation step 3: (setq files (sort (find-all-files clean-folder) compare-ti...
- Fri Jun 24, 2016 6:29 am
- Forum: newLISP in the real world
- Topic: Convert list to string
- Replies: 1
- Views: 3267
Re: Convert list to string
Code: Select all
(string x)
If you search
Code: Select all
: (blah
- Mon Apr 11, 2016 1:32 am
- Forum: newLISP in the real world
- Topic: pack-newlisp, utility for embedding
- Replies: 1
- Views: 3858
Re: pack-newlisp, utility for embedding
I removed the attachment, and rather made the software available at github: git clone https://github.com/ralph-ronnquist/pack-newlisp.git If you happen to use it and in particular prepare a new head file, then please add it to the bundle. Right now it only includes "head files" for Linux i686, Linux...
- Tue Apr 05, 2016 11:14 pm
- Forum: So, what can you actually DO with newLISP?
- Topic: Quaternion Calculus
- Replies: 5
- Views: 6978
Re: Quaternion Calculus
... and interesting; taught me something new (for me); thanks.
- Sat Mar 12, 2016 12:29 am
- Forum: newLISP in the real world
- Topic: pack-newlisp, utility for embedding
- Replies: 1
- Views: 3858
pack-newlisp, utility for embedding
Yet another embedding approach; now using tar for the application. ** pack-newlisp version 1.1. Utility for managing self executable newlisp tar. Usage 1: pack-newlisp p <filename> <architecture> <tar data arguments> Pack an application for the given architecture (`uname -m`) into the given filename...
- Wed Feb 17, 2016 9:22 pm
- Forum: newLISP and the O.S.
- Topic: I/O error
- Replies: 4
- Views: 6253
Re: I/O error
If possible, try running it with strace
Then reduce the LOG file to the stat, open and error lines with
Doing that might give a lead to where the problem arises.
Code: Select all
strace /usr/bin/newlisp |& tee LOG
Code: Select all
egrep '(stat|open|ERR)' LOG
- Sun Jan 24, 2016 1:28 am
- Forum: newLISP newS
- Topic: newLISP v.10.7.0 Stable Release
- Replies: 21
- Views: 21240
Re: newLISP v.10.7.0 Stable Release
Incidentally, the "UBUNTU on amd64 UTF-8 enabled" package installs nicely on Debian 8 (Jessie) as well, and probably the non-UTF-8 version does as well. However, the zlib.lsp module needs an update to insert a path option "/lib/x86_64-linux-gnu/libz.so.1" ; Debian 8, 64bit That path option is also f...
- Fri Jan 22, 2016 5:48 am
- Forum: newLISP newS
- Topic: newLISP v.10.7.0 Stable Release
- Replies: 21
- Views: 21240
Re: newLISP v.10.7.0 Stable Release
On the downloads page, I noticed that the Ubuntu packages are wrongly named:
though being for amd64 rather than i386.UBUNTU Debian installer newLISP v.10.7.0 for UBUNTU on i386
UBUNTU Debian installer newLISP v.10.7.0 for UBUNTU on i386 UTF-8 enabled
- Sun Dec 06, 2015 10:12 am
- Forum: newLISP in the real world
- Topic: Closing stdin for sub process
- Replies: 6
- Views: 7723
Re: Closing stdin for sub process
The latter function seems to have lost the expression (close outrem) that should follow the process expression. Without that, the pipe is of course held open by the parent process having an open write-end. By the way, your first function works fine for me if you skip using peek and just call read in...
- Wed Nov 25, 2015 10:36 pm
- Forum: newLISP and the O.S.
- Topic: unix.lsp / unix:syslog, example please
- Replies: 5
- Views: 6900
Re: unix.lsp / unix:syslog, example please
Seems it gets somewhat happier including %d and %m in the format; i.e. (unix:syslog 5 "%d %m") Doing so at least avoids the vprintf crash (Ubuntu 14.04.3 64bit), but the message is still garbled. Basically, from experimenting it appears that the format string can be without indicators, or it should ...
- Sun Nov 22, 2015 12:53 pm
- Forum: newLISP in the real world
- Topic: nL with Snappy Ubuntu Core
- Replies: 3
- Views: 5651
Re: nL with Snappy Ubuntu Core
As far as I can read, there's nothing not possible in that idea. Of course, if newlisp is not included in the basic framework, you'll have to include it in your "snap". But all in all the "snap" notion appears to only concern the application packaging; essentially going back to "static linking think...