freenode/#lisp - IRC Chatlog
Search
17:59:12
drmeister
The docs say - Return a foreign pointer to VECTOR(including its header). VECTOR must be a vector created by MAKE-STATIC-VECTOR.
18:24:31
jmercouris
I want to go over some objects, manipulate them, and then collect some operations on them
18:26:56
jmercouris
I literally just wrote (loop for object in object-list do (method-call object) collect (accessor-call object))
18:32:06
ggole
(loop for i in (list 1 2 3 4 5) when (evenp i) do (incf i) collect i) vs (loop for i in (list 1 2 3 4 5) when (evenp i) do (incf i) and collect i)
18:33:35
jmercouris
I know they are much more common in C languages, but there are still use cases for flags in lisp, and I'm not sure how to name them
18:33:55
jmercouris
I have a database where I have a flag that indicates an account has been manipulated in some way that requires processing
18:34:04
verisimilitude
Also, you can avoid the AND if you just use END to delimit conditions, instead, which is what I use whenever something gets difficult to understand at a glance.
18:37:27
verisimilitude
I suppose an alternative convention would be is- or are-, as in ARE-TARGETS-CHANGED?
18:38:49
sjl
What airport are folks flying into for ELS this year? MXP, and then take public transit to Genova?
18:49:50
sjl
Yeah, not sure how efficient it'll be coming from the US though. There are direct flights from jfk <-> mxp at least. I'll poke around on ITA though
18:52:11
cage_
yes i also do not think there are direct flight form US, but it should not be a long journey from Milan to Genova
18:58:40
sjl
The US itself is within a few percent of the size of Europe. So when I'm looking at different cities on the map trying to figure out how to get to ELS I need to remind myself to calibrate my expectations properly.
19:00:05
surrounder
3.5 hours will get me in places where I won't understand anyone and the culture will probably be different too\
19:15:38
emaczen
the paste gives a backtrace showing where I call make-instance with several keywords and their corresponding arguments, and then two initialize-instance methods that are called, but the keyword arguments became nil...
19:16:16
emaczen
I write after methods on initialize-instance all the time, and I have never seen this happen before
19:19:00
emaczen
The only difference from my past usage of make-instance is that the object's class is a subclass of standard-class, but I've only overriden validate-superclass, and added an after method on ensure-class-using-class
19:38:31
sjl
... how in the hell can it possibly be six (6) USD per day to rent a car from MXP? Is Kayak lying to me? If so, heck, I'll just drive to ELS from MXP.
19:51:20
jmercouris
it appears more expensive on paper, but that is the true price, and they won't play games with you when it comes to insurance claims, upselling, and the like
19:52:36
sjl
I might rent a car anyway. I took the entire week off from work, so after ELS I might go to Florence and visit some of the math-related museums.
19:59:09
lumonom
Hey i am really new here so pls tell me if i do something wrong. I wanted to ask if there is an easy way to check if a float number only has a 0 after the decimal point
20:47:52
makomo
check out the section "understanding compiler diagnostics" or something similar in SBCL's manual
20:49:51
makomo
yeah, in any case, it's not seeing DEFTABLE as a macro but as a normal function, so it goes on to examine the arguments
20:50:02
jmercouris
I'm going to clear my cache and recompile on my own machine and see if I have issues
20:52:11
jmercouris
though it may be faster this time, since all of the dependencies are compiled, I'll do it as a last resort
20:58:52
dxtr
Can I do something like (loop for (a b) on '((1 2 3 4))) where (a b) has a length that depends on a variable?
21:00:47
makomo
dxtr: assuming arbitrary lengths, would you then access the destructured elements? you wouldn't know how many to destructure
21:01:38
makomo
LOOP's destructuring acts (almost, there's some corner case or something) like destructuring-bind's, so you can use stuff like &optional, etc.
21:01:50
dxtr
Well, if I could catch them as a list then that'd be great because that's essentially what I want to do
21:04:13
sjl
I don't think it's true that you can portably use destructuring-bind type stuff in LOOP binding clauses
21:04:38
sjl
Destructuring allows binding of a set of variables to a corresponding set of values anywhere that a value can normally be bound to a single variable. During loop expansion, each variable in the variable list is matched with the values in the values list. If there are more variables in the variable list than there are values in the values list, the remaining variables are given a value of nil. If there are more
21:06:31
sjl
You can use a dotted list to do the equivalent of &rest, and you can use NIL to ignore values, but it's not full destructuring-bind level of power.
21:07:44
dxtr
Well if it's not possible it's not possible. Just figured that it doesn't hurt to ask so I don't re-invent stuff that exists
21:09:28
sjl
dxtr: it's still not clear what you're trying to do. That example will return '((1 2) (2 3) ... (9 10) (10 nil)). Is that not what you want?
21:09:48
makomo
dxtr: i'm not completely sure what you want to do. the example you gave above evaluates without errors. i was expecting an example where you provide the destructuring, the input and the values of A and B you want
21:12:26
Bike
well, you can't get a bunch of variables (like A and B) from a number, you'd get a subsequence
21:12:36
sjl
There's no way to do that kind of thing with destructuring, no. You could do something like:
21:12:52
sjl
(defun ngrams (n list) (loop :for x :on list :repeat (- (length list) n) :collect (take n x)))
21:13:35
Bike
you could do (loop for sublist on list by (lambda (l) (nthcdr n l)) for real-sublist = (subseq sublist 0 n) ...work with real-sublist here...)
21:13:49
makomo
dxtr: as mentioned, you can't really do that with destructuring. the problem is that X is a run-time thing, while the destructuring specification has to be known at compile-time, at the moment you write the code (and "tricks" like &rest don't really help here)