libera/#commonlisp - IRC Chatlog
Search
22:49:40
pjb
jackdaniel: the negate operator in CL is - (let ((unsigned-integer 42)) (- unsigned-integer)) #| --> -42 |# what do you have against it?
22:50:54
pjb
phoe: my point, the length needs to be known before hand. And therefore (logand #xffffffff (lognot x)) eg if it's 32.
22:52:20
pjb
42 is …000101010 in binary; it's bitwise negation should be …111010101 ; computing …000101010 --> …000010101 seems meaningless to me.
22:54:22
pjb
Now, you may consider 1-complement, or 2-complement, with a predetermined word length. (logand #xff (lognot 42)) #| --> 213 |# may seem strange, but bitwise is clear: 00101010 --> 11010101
23:03:38
ldb
ACTION just completed adding lisp symbol index to CLtL2, would not consider add the glossary
23:27:17
morganw
I'm pretty sure that the Winston and Horn book has a section which implements an infix form converter.
23:31:09
White_Flame
most lisp infix tools deal with (1 + 2 * 3) sorts of forms, not strings, so breaking apart the string will be a separate issue.
23:31:38
ldb
as these days there are plenty of parser generator I just recommand to try build one with them, like https://github.com/eugeneia/maxpc
2:58:28
edgar-rft
nij-: there's an infix macro written by Mark Kantrowitz somewhere in the CMU archives that can compute infix math expressions
7:47:12
jackdaniel
White_Flame: pjb: kakuhen: phoe: thanks. yes, after examining a bit closer the protocol, there is always a surrounding logand operator, so the negative value will be yanked either way, so I'm good with (logand #<something> (lognot #<the number>)) ; the issue was that the negation was used with unqualified integer values (i.e 3), so I couldn't know how many bits the number had