freenode/lisp - IRC Chatlog
Search
16:45:06
Petit_Dejeuner
Is there a way to use peek-char on a binary stream or an equivalent for binary streams?
16:47:32
Petit_Dejeuner
Thanks. That's kind of lame. I guess I could rewrite this to only use read-byte.
16:50:25
Petit_Dejeuner
Xach: Replace all instances of peek-char with it. I'm writing (yet another) bencode library and I use peek to help me decide what the next item is.
16:52:43
Petit_Dejeuner
jackdaniel: "bencode?" https://wiki.theory.org/BitTorrentSpecification#Bencoding
16:53:03
Petit_Dejeuner
a binary format that supports similar structure to json, it's most popular use is for torrent files
17:37:52
flip214
phoe: you could also have a CONCATENATED-STREAM that consists of a #\(, the file, and #\) ...
17:38:51
beach
phoe: (with-input-from-string (stream (read-line)) (loop with eof = (list nil) for expression = (read stream nil eof) until (eq expression eof) collect expression))
18:02:26
didi
phoe: Because I am defining a new type when I wanted to use EQL to compare objects of this type.
18:04:20
phoe
didi: best define your own predicate, foo= that accepts two objects of type foo and does its comparison login.
18:06:18
phoe
If two objects can be equal despite not having the same identity, then you need to define your own predicate and therefore teach Lisp how it should think about such equality.
18:07:18
phoe
And as for the general case of equality, there were a few articles about equality in Lisp circling around.
18:13:24
didi
phoe: Thanks. I think I will create my own predicate. SBCL's manual says "Thread type. Do not rely on threads being structs as it may change in future versions.", which scares me a little.
18:16:54
didi
Because I will create and manipulate many of them and I want to check if I am on a cyclic dependency.
18:22:03
White_Flame
for struct instances, equal is the same as eq. It's only equalp that walks structure slots
18:35:47
rpg
Anyone an expert with CL-DOT? I'm trying to ensure that a tree graph generated that way renders its children left to right in the order they appear in the points-to methods. But at least sometimes, they are coming out backward.
19:24:52
aeth
How do I use a subrange of a CFFI array? Do I just use a pointer to (* type-size offset)?
19:27:43
axion
Is there an easy way to get rid of the #<> characters when printing an object with PRINT-UNREADABLE-OBJECT?
19:28:02
aeth
Would doing this create garbage? e.g. if I did (cffi:make-pointer (+ (cffi:pointer-address original-pointer) (* type-size offset)))
19:28:36
aeth
This is for the GL matrices in my draw function. I cannot create garbage in my draw function.
19:31:43
aeth
I can just iterate on pointer objects that I've already created if that's the way to do it. Does anyone else have to do something like this?
19:38:38
axion
I must use the pprint-dispatch table instead of PRINT-OBJECT because these are not classes, but instead structs compiled to a :type.
19:41:40
malice
axion:anyway, quoting the clhs: " Outputs a printed representation of object on stream, beginning with ``#<'' and ending with ``>''. "
19:41:54
malice
that's how print-unreadable-object is designed. You are probably looking for something else.
19:51:04
Bike
you can print the class-name or whatever like print-unreadable-object does yourself, if you want
19:59:50
axion
Another question. Is it legal to have a compound function name like (setf func) in the function-names position of (declaim (ftype (function ..))), or must it be a symbol to be portable?
2:15:23
nyef
What SBCL API changes? SBCL's public API didn't change in any way that requires changes to other software. And private API changes are a matter of "what the heck are you doing poking around in there?!?"