freenode/#lisp - IRC Chatlog
Search
20:56:21
drmeister
The ASDF version that ships with Clasp is 3.3.1.2 - is quicklisp getting some other version of ASDF?
20:56:43
drmeister
I feel like I've seen this before and fixed it and now it's back again - but it's been at least a year.
21:03:48
drmeister
It happens when I build cando within a docker image - maybe I'm cloning another ASDF in the Dockerfile.
21:08:56
k-stz
I just updated to emacs26.1+slime2.0 and it freezes for a short time everytime I type in an argument to a function at the repl. It does so for every character
21:17:42
k-stz
just found a thread on reddit with exactly the same problem: https://www.reddit.com/r/emacs/comments/8nyl9w/errors_in_sbcl_slime_repl/
21:41:00
msmith
so I'm trying to read utf-8 bytes from a file for testing purposes. For some reason, when I read-byte I'm not getting what I expect. here is the paste https://pastebin.com/9rySSXTK
21:49:21
pjb
Theorically, an implementation could have different binary file formats, but in practice, not on posix systems.
21:49:37
Bike
the external format tells lisp how to convert bytes into characters. you're not having it do that, so, pointless.
21:50:23
pjb
msmith: a file containing text encoded in utf-8 won't contain any null byte. Your file, starting with 129 0 0 0 126, assuming those are the values of the 6 first bytes, is not an utf-8 encoded file.
21:51:09
pjb
msmith: on the other hand, if your file starts with the string "129 0 0 0 126", then the bytes are actually: (map 'list 'char-code "129 0 0 0 126") #| --> (49 50 57 32 48 32 48 32 48 32 49 50 54) |# and this INDEED starts with the byte 49 which is the ASCII or utf-8 code for #\1 !!!
21:51:56
pjb
So if your file is a TEXT file containing integers representing the values of octets, you must read it as a text file, and use READ to parse those integers.
21:53:07
pjb
(with-open-file (s p :direction :input :element-type 'character :external-format #+sbcl '(:utf-8 :replacement #\?) #-sbcl :default) (loop for byte = (read s nil nil) while byte collect byte))
21:53:59
pjb
msmith: you may want to have a look at: https://www.cliki.net/CloserLookAtCharacters and I might write someday a similar page about binary files…
21:55:34
msmith
yeah, I was under the impression that the external format option would cause the with-open-file to read the integers as bytes
21:55:52
pjb
And yes, don't laugh, but we find this kind of representation/encoding problem a lot of times, in places it shouldn't appear. People (well, "C programmers") don't understand the difference between binary and text, and that hexadecimal is a textual representation for binary, etc.
21:56:34
pjb
And worse, those idiots write data as hexadecimal textual representation and are not able to parse it back in a case insensitive manner, so you find broken middle ware in places you wouldn't believe…
21:57:03
Bike
if you deliberately wrote in the integers that's a more normal mistake than i was imagining, anyway
21:58:01
pjb
In lisp you have to be careful indeed, because you can write a textual representation of a sequence of bytes easily with PRINT in a text file. But it is as easy to write it in binary form with WRITE-SEQUENCE in a binary file.
22:06:57
karlosz
is there any way to check if a symbol is external in a package without do-external-symbols?
22:09:57
pjb
(multiple-value-bind (ps sk) (find-symbol (symbol-name s) p) (and (eq ps s) (eq :external sk)))
3:08:47
DataLinkDroid
ACTION wonders if there is anyone here who has any experience with using CFFI to load and call functions from an Ada 2012 standalone shared library.
3:09:49
DataLinkDroid
I'm not having much luck with my first attempt at this, even though I have tinkered with CFFI before with C libraries, successfully.
3:21:45
DataLinkDroid
ACTION created the Ada 2012 library (with exported functions according to C standard), so the issue could lie on either side.
3:23:43
DataLinkDroid
ACTION can call the Ada functions fine from C code, but Ada library initialisation seems to case the lisp to crash with a stack or memory error, which appears to be raised from within Ada land.
3:32:29
DataLinkDroid
The exception raised after library init is: raised STORAGE_ERROR : stack overflow or erroneous memory access
3:33:09
DataLinkDroid
This looks like an Ada message. So it appears to be getting itself into some kind of trouble while initialising itself.