freenode/#lisp - IRC Chatlog
Search
9:52:41
|3b|
and another goal is that it could have a (declare (type (simple-array :single-float (*)) z)) declaration somewhere, so the generated function wouldn't need to do any checking on the individual values from Z to decide if it could write them as a float
9:56:10
|3b|
other notable features are that the runtime spec doesn't have any data for 'foo2 in toplevel, or 'c in bar-type, and similarly, the person-written code doesn't write 'baz or 'd, but code is generated for them (and no code is written to write default values for other slots that are then overwritten by user code)
11:14:31
theemacsshibe[m]
What's a good way to save an object? I've just been formatting ~s objects to files and using read to read them again but using format feels a bit odd.
11:17:26
theemacsshibe[m]
Docs suggest that, seems pretty straightforward. I'll install Quicklisp in the morning.
13:36:03
didi
Why does https://github.com/tarballs-are-good/quickutil/blob/5adb3463d99095145325c4013117bd08a8f6cac2/quickutil-utilities/utilities/sequences.lisp#L118 declare FLET functions as dynamic-extend? I only know about dynamic-extend because of Costanza's c.l.l. post.
13:39:40
lieven
and in old speak to state that they're downward funargs. that also enables some optimisations.
13:55:17
didi
stylewarning: I am interested in why did you declare the labels functions as dynamic-extend in `equivalence-classes'.
13:56:39
stylewarning
didi: generally if I don’t want to save the function objects created by labels, I’ll declare them as dynamic extent, so the compiler knows it can allocate and free the memory right away
15:38:59
z3t0
is there a construct in lisp where i can do x and then evaluate if and then do x if the if evaluates to false?
15:39:45
z3t0
here's what i have, http://sprunge.us/eZNY Except I want the input to precede it as well
15:41:03
beach
(progn x (unless condition x))? Is that what you mean. I am having a hard time understanding what you want.
15:41:45
z3t0
okay so essentially I want to loop a request to the user for some input, as long as the input is not valid
15:48:49
z3t0
Just so I understand, the reason for funcall is because I am storing a function inside a variable?
15:56:31
z3t0_
okay so I have (until (funcall x y )) which exits the loop as needed but then how do i return y there?
16:05:30
z3t0_
Any recommendations for parsing floats from strings? There seem to be many different ways it is done?
16:20:48
z3t0
I am trying to write an (if b (something) (else)) but it seems to complain that the form is incorrect
16:25:27
Bicyclidine
that's perfectly helpful, you can see you have :type-converter set up as a keyword parameter
16:31:47
dim
using uiop:run-program :output :string here, is there a way to somehow plug babel or something in there?
16:31:51
didi
I'm back. If anyone want to comment on <https://paste.debian.net/hidden/bcf2c844>, please.
16:40:39
z3t0
can anyone recommend a resource that explains how to use loop but is also easy to approach for beginners
16:54:45
didi
I thought of using `listp' and `vectorp', but then I remembered SBCL has extensible sequence types.
17:02:22
z3t0
I am creating a program in lisp that stores a set of images with latitude and longitude coordinates for the center of the images
17:03:10
z3t0
I need to create a system so that I can store all of the images with lat and lng and then write a function that takes lat and lng and then finds the closest image
17:03:11
_death
stylewarning: uh, no... it is passed to MAP.. but then, there shouldn't be an NREVERSE anyway, unless it's meant to be a destructive operator
17:04:05
didi
_death: I used `nreverse' for performance reasons, because `subseq' creates a new sequence anyway.
17:05:10
stylewarning
didi this isn’t universal among all lisp users but I prefer to prepare my data before executing on it, especially if it contains somewhat complicated logic
17:05:46
stylewarning
Here you have the logic of slicing and reversing, and it’s nice to make that evident before mapping (IMO)
17:08:51
_death
z3t0: if you're using a database, it is also possible that it has a solution for that
17:12:28
_death
z3t0: it seems redis added spatial queries.. guess I'll have to update my lredis library at some point in the future :)
17:35:34
_death
(funcall (if condition #'do-something #'identity) datum) ; if you like convoluted code
17:35:55
oleo
(progn (when (not predicatedp) datum) (dosomething predicatep)) or if you are in an implicit progn would do too
17:37:18
didi
Maybe I should write a macro like (do-when predicatep fn datum). Doesn't look better, tho.
17:38:42
z3t0
I'm trying to understand spatial-trees and I get the idea of it but am a bit confused regarding implementation
17:43:51
z3t0
Can anyone help me understand https://github.com/rpav/spatial-trees/blob/master/tutorial.lisp line 30
17:54:37
z3t0
how do i use the package "rectangle" from https://github.com/rpav/spatial-trees/blob/master/api.org
17:55:03
z3t0
I am using quickload which gives spatial-trees as an object but i cant figure out how to access the rectangles package
17:58:10
Bicyclidine
it looks like there should be a rectangles package as part of the spatial-trees system?
18:05:08
oleo
it informs you of symbol conflicts between the rectangles and the spatial-trees package
18:21:08
oleo
by loading systems you get the packages but there's no way to get the packages alone via asdf
18:21:45
oleo
or at least know which systems contain it as a component and load one of the supersystems
19:41:54
oleo
well if you deleted some of your directories in the quicklisp branch, just do another load with quicklisp and it will redownload some stuff
19:42:26
dxtr
My actual problem is that cl-sdl2 broke and I suspect it might be because I have updated sdl
19:53:54
White_Flame
quicklisp itself doesn't hold anything but the project sources, so you don't need to erase & redownload those, unless you suspect your filesystem is corrupted or something trampled the data there
20:17:26
iqubic
So a macro can only consist of a single body form? Which is expected to be the backquoted replacement code?
20:18:18
Shinmera
A macro can consist of any number of body forms, but it can only /return/ a single one.
20:22:11
iqubic
Can a macro have multiple s-exps in the body, so long as it only returns a single s-exp?
20:23:15
dlowe
iqubic: yes. It can also return a PROGN form, so you can still do multiple things from a macro
20:27:30
pjb
(defmacro one-of ((&body body) &rest other-bodies) `(case (random ,(1+ (length other-bodies))) (0 ,@body) ,@(let ((i 0)) (mapcar (lambda (body) `(,(incf i) ,@body)) other-bodies)))) (macroexpand-1 '(one-of ((print 'hi)) ((print 'fizz) (print 'buzz)))) #| --> (case (random 2) (0 (print 'hi)) (1 (print 'fizz) (print 'buzz))) ; t |#
20:29:56
pjb
iqubic: Common Lisp: A Gentle Introduction to Symbolic Computation http://www.cs.cmu.edu/~dst/LispBook/ http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html
20:32:28
pjb
If the *read-base* is 2. then (+ 1 2) is read as a lists containing two symbols, + and \2, and a fixnum: 1.
20:53:49
iqubic
Well, I solved my issue. I had forgotten to unquote a variable name in my macro expansion.
21:06:48
iqubic
Now that I have successfully created a macro, I understand how and why you use them.