djuber` has quit [Remote host closed the connection]
Oladon has joined #commonlisp
xristos has joined #commonlisp
gnoo has joined #commonlisp
X-Scale has quit [Quit: Client closed]
X-Scale has joined #commonlisp
Oladon has quit [Quit: Leaving.]
dipper_ has joined #commonlisp
<bitblit1>
Hello Everyone!
<bitblit1>
Nice day today. Really starting to like the simple structure of my window manager
<bitblit1>
from the advice I received here
X-Scale has quit [Quit: Client closed]
<edwlan[m]>
I think a good book is likely to be a bit verbose to many people: you need to say the same things multiple ways because different readers will find different formulations helpful
<edwlan[m]>
And you have to provide details that some readers won’t need
<bitblit1>
I still get confused whenever I want to use eval. How do I run quoted code without testing for input and putting it into an eval?
<hayley>
What do you mean by "testing for input"?
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
<bitblit1>
To prevent SQL injection for example
<Bike>
what the heck does sql have to do with eval
<bitblit1>
Sorry, let me elaborate a bit more:
<hayley>
In SQL there is a concept of a "prepared statement" which you basically should never not use.
<bitblit1>
I am not working with sql, it was just an example
<hayley>
The equivalent in Lisp is a function.
tyson2 has quit [Remote host closed the connection]
<Bike>
if what you're asking is how do you let your users evaluate arbitrary code without screwing up your program, the answer is generally "you don't"
<bitblit1>
I have a function lets say GET-MASK which has a &rest argument. I want to pass a list to it, and I want to return the output of the function get-mask and NOT the code.
<bitblit1>
The macro byitself as shown in the Example documentation works perfectly
<bitblit1>
but when I try to compile the class
<bitblit1>
It gives me this error: error: don't know how to dump #<KEYBINDING {10014E9743}> (default MAKE-LOAD-FORM method called).
<bitblit1>
And gives a red wiggly line below (create-keybindings after the :initform keyword
<bitblit1>
Please help :(
<beach>
You have some literal in your code that the compiler needs to dump into a FASL file, but it doesn't know how to do that. Some objects (like functions) can not be dumped at all, and for some others, like instances of standard classes, you must tell it how to do it. But most of the time, it is not really what you want to do.
<hayley>
Modify the macro so that it expands to something involving (make-instance 'keybinding ...), rather than constructing an instance of KEYBINDING in the macro-expansion.
<bitblit1>
Oh, i understand thanks, lets try that.
<splittist>
DO (or :do) takes a compound form, so you can just say :do (print ...) (return i). All the forms until the next loop name command thingy will be part of the do, if you see what I mean.
<bitblit1>
splittist: I understand, but my question was if I just wanted to use the :when keyword, the :return keyword etc.
<splittist>
I think the answer is 'no'. For example, how would your compiler know the difference between an 'embedded' and 'top-level' RETURN?
<splittist>
Unless you use AND, perhaps. (loop for i below 100 when (> i 5) do (print i) and return i)
<pjb>
bitblit1: I would write it a (loop for i from 0 do (print i) until (= i 5) finally (print "Goodbye, I reached five.")) ; I see no point of returning 5, but you can add it.
<splittist>
Is there any reason why a loop for-as-hash with hash-values on sbcl 2.2.6 wouldn't be reliable? (In the sense of a value that isn't a hash-value turning up?)
tyson2 has joined #commonlisp
NotThatRPG_ has joined #commonlisp
<yitzi>
splittist: It just uses with-hash-table-iterator so I would try that and see what happens.
<splittist>
yitzi: it's weird. ALEXANDRIA:HASH-TABLE-VALUES gives me what I expect (and works, so I'll move on), but even ALEXANDRIA:MAP-HASH-VALUES (which is the basis of hash-table-values) gives me a rogue 0. I'm sure it's something I'm doing that I don't understand.
euandreh has quit [Quit: euandreh]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
kevingal has joined #commonlisp
<pjb>
splittist: you should avoid mutating the hash-table while iterating (be it with with-hash-table-iterator, maphash, or loop for-as-hash).
<pjb>
hash-table-values is nice, but it uses temporary memory. This may be required if you must mutate the hash-table.
<jeosol>
splittist: basically, I have these massive json configs that I want to flatten, so the original json with multiple levels is reduce to one level with keys and values. They keys for the deeply nested object is gotten by prepending their keys with those of their parents separated by a dot. That pandas link does explain the operation.
rgherdt_ has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
lagash has joined #commonlisp
morganw has quit [Remote host closed the connection]