freenode/#lisp - IRC Chatlog
Search
3:19:42
aeth
Fair point. I've mostly used read for things like configuration files and programming languages, where the user is essentially trusted.
3:27:51
jasom
aeth: almost all architectures introduced after 1990 support at least 3 return values with zero overhead (and 8 is not unusual) in hardware; there is no cost to the caller if it doesn't use them, and the cost to the callee is only an extra register store (to marke the RV count)
3:29:23
jasom
aeth: well Power, ARM and MIPS can each do at least 8 (though the common ABIs often don't define that many, it is 100% compatible to use all caller-save registers)
3:32:32
jasom
x86-64 ABI specifies 7 volatile registers, so 6 return values could be done cheaply; I'm not sure if sbcl does this though...
3:34:24
jasom
looks like SBCL on'y uses 4 of them for return values, and one is a count, so 4 will require stack access
3:59:15
cryptomarauder
mfiano: I am a string whore myself which may not work on some systems applications but for keeping the format good on something like 1.0f0 unaltered I throw it in a string like a do tortillas. Otherwise if it's not dealing with standardized definitions which would endure the data integrity in your output you just can't be sure in a portable way.
4:02:42
lildragon
Is there a good book/guide to learn (Common ?) Lisp that is straight to the point?
4:03:12
minion
lildragon: look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
4:03:22
lildragon
And Practical Common Lisp is too verbose. I don't care about your dad, I don't need you to repeat the same idea five times for me to learn how a list works.
4:03:32
parjanya
what’s the smart way of getting just some values that get-decoded-time outputs? if I use multiple-value-bind it gives me a warning if I don’t use all the variables... I thought of using multiple-value-list and then selecting just the parts I want, but isn’t there a better way? something like (grab (0 2 4) (get-decoded-time)) to output only the first, the third and the fifth values
4:03:48
lildragon
mfiano: Thanks, see my problem with the book, two chapters in and I am already bored. :P
4:04:21
mfiano
lildragon: That's ok, because the book is very short, and you won't find another like it.
4:05:22
lildragon
"A single record, however, does not a database make. You need some larger construct to hold the records. Again, for simplicity's sake, a list seems like a good choice."
4:05:27
mfiano
You could start with Common Lisp Recipes, which is a bunch of concise "recipes", but it is designed to be a companion to PCL.
4:12:52
parjanya
beach: thanks! is this decent, (list (nth-value 5 (get-decoded-time)) (nth-value 4 (get-decoded-time)) (nth-value 3 (get-decoded-time))), or would be better to collect the values in a list and then extracting what I want from it?
4:14:22
aeth
And for the things you don't use, just do this so the compiler doesn't warn you: (declare (ignore foo bar baz))
4:18:33
pfdietz
Might use it for variables that will just be used in, say, debugging or logging statements that may or not actually be compiled (due to #-/#+ or macros).
4:43:29
lildragon
beach: It looks really good in terms of the content, the user interface is monstrosity though.
4:45:18
lildragon
beach: Couple of hours into finally committing to learn Lisp I see a common pattern across everything lisp related, there is a strong commitment in the early ages of computer human interaction (I avoid the term UX because that is too modern). :P
5:25:03
lildragon
beach: I think it is not that bad after all, thanks for reminding me that it is not that long.
7:16:38
cryptomarauder
Nice chat. You guys never quit being eager to help. I am such a lurker but I get so much with virtually no snark. Golden lol
9:59:24
phoe
On SBCL: (trace (setf config)) ;;=> WARNING: (SETF CONFIG) is not a valid function name, not tracing.
10:06:18
Shinmera
It's been a while since I implemented it, but I remember discussing the available options at the time and coming to the begrudging conclusion that a SETF "pre-processor" is the best way to go
10:06:55
Shinmera
It was something about the SETF facility not giving you access to a variable amount of multiple values, which I needed.
10:07:06
phoe
AFAIK needs to be a custom one because of how Qtools hacks around the reader - only the symbols requested by the client code are generated, et cetera.
10:09:33
Shinmera
Essentially (setf (q+:size foo) (values 400 500)) is read as (setf (q+ set-size foo) (values 400 500)), so in that case it needs two values, but let's say (setf (q+:rect foo) (values a b c d)) needs four and so forth.
10:10:35
Shinmera
Anyhoot, the SETF wrapper turns that into (q+ set-size foo 400 500) or whatever else depending on the VALUES form.
10:11:34
Shinmera
You might think I could just specify like a hundred values or something expecting that no function call will ever need that many, but then you also never get any information from SETF about which values were actually passed and which weren't, so you can't compose the proper call.
11:01:09
makomo
jasom: regarding that cl-json hash table thing from yesterday, are you sure that works?
11:01:35
makomo
because i keep getting an error from the internals of cl-json when the body of my *beginning-of-object-handler* is run
11:13:01
beach
I just hate that kind of error message. It contains absolutely no information that is of value to even the most novice Common Lisp programmer.
11:13:29
phoe
Haha, I just got hit by a similar message an hour ago and spent thirty minutes debugging it.
11:14:23
Shinmera
Rust's compiler is pretty nice about error messages, but I don't know if you could replicate that kind of experience for run-time errors.
11:14:32
makomo
jasom: yup, my bad. i delayed the writing of your "to-keyword" and in *object-key-handler* just forwarded the call to the original handler, but that makes no sense because that handler expects all sorts of internal state to be already built (set up by *beginning-of-object-handler*, etc.)