freenode/#lisp - IRC Chatlog
Search
4:15:12
drmeister
Say I have a vector of some number type and I want to convert it to a vector of single-floats - I have to convert the elements one by one - right?
5:32:43
beach
SaganMan: I am fine, thank you. I have been making excellent progress on bootstrapping the past few days. What about you?
5:34:38
SaganMan
beach: I'm in my family business. It's real estate and construction. We take land for development and construct apartments.
5:37:38
SaganMan
beach: We don't usually do projects on that grand scale. That is the biggest investment in mine and my father's life. It looks impressive but it's great risk and stress.
6:20:48
no-defun-allowed
well my ffmpeg interface is still shitslow at 4fps but the videos aren't broken now
11:26:09
makomo
pjb: i managed to find one occurence of the (4) (3) ordering, https://www.hexstreamsoft.com/libraries/place-utils/#funcallf-applyf
11:26:38
makomo
granted, funcallf is just _f in disguise, but the evaluation order has been explictily documented (and therefore thought through)
12:14:41
adlai
"risk and stress" ... yep, that sounds like components of the construction Hamiltonian. story checks out!
12:48:12
phoe
I'm running code that's fifteen years old and the only thing that was really required is fixing it to use ASDF.
12:52:05
_death
phoe: check copyright date range @ https://bitbucket.org/dfmorrison/roan/src/e43b5ae8af0aba6930f0183a4afbc7e3e004da1e/roan.lisp?at=master&fileviewer=file-view-default
13:10:18
pjb
phoe: https://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html if you can run that, then wordnet!
13:12:10
pjb
smokeink: have a look at https://www.informatimago.com/articles/usenet.html#C-like-pointers-in-Lisp
13:15:19
pjb
smokeink: your code is full of bug, that's why I cannot say anything consistent about it.
13:17:24
smokeink
pjb: ignore f, I first typed that f function to specifically ask whether myvar can access that a in some way or not
13:18:59
smokeink
I just wrote a snippet, I didn't paste my actual code because the actual code has other unnecessary details
13:21:49
phoe
(get-synonyms "horse" :noun) ;=> (("horse" 0) ("horse_cavalry" 1) ("cavalry" 1) ("horse" 0) ("Equus_caballus" 0) ("horse" 3) ("gymnastic_horse" 0) ("sawhorse" 0) ("horse" 1) ("sawbuck" 0) ("buck" 0))
13:22:58
pjb
smokeink: you test for (functionp myvar) and then in the case you test for symbols. Therefore the case will always return nil, if myvar is bound to a function, and the IF will return nil if not.
13:23:38
pjb
smokeink: a compiler can detect that at compilation time, so it can generate (lambda (a b) (declare (ignore a b)) nil) instead.
13:27:09
smokeink
no question for now, I'll first try to see if declaring vars special will work well or not
13:35:31
phoe
But it would be bold for me to assume any license at all if the author put none on it.
13:36:48
phoe
pjb: I did. All I have is the email address @ai.mit.edu which might or might not work after all these years.
13:51:05
phoe
pjb: there's no mailserver at ai.mit.edu. I have no direct means of contacting the author.
13:58:05
pjb
phoe: since it comes from the MIT, it might be under the MIT license. But you'd need confirmation.
14:10:47
oni-on-ion
aeth: check out recent release notes if you havnt already, http://www.sbcl.org/all-news.html , like 1.4.10 adding or subtracting 1 from a fixnum does not cons. =)
14:13:15
pjb
smokeink: I wouldn't worry about that for now. Just build your system, and make it work. If there remain time then, you will be able to have more philosophical questions…
14:13:24
smokeink
Since my code is a bit complicated than this snippet, it might result into many ifs and cases , and that's not very nice. Just wondering if you guys can spot a different solution
14:14:14
phoe
if yes, you might want to instead go CLOS and use a generic function; this will move the dispatch from a massive CASE into individual methods
14:15:05
phoe
(defclass apple ...) (defclass banana ...) (defgeneric frobnicate (fruit)) (defmethod frobnicate ((apple apple)) ...) (defmethod frobnicate ((banana banana)) ...)
14:15:21
pjb
You could have a table of predicate and functions to generate the code, so you'd just write (funcall (optimization-generate (find-if (lambda (predicate) (funcall predicate myvar)) table :key (function optimization-predicate))))
14:16:37
jackdaniel
the question is: what is easier to optimize: a few symbols + typecase or a few classes + gf dispatch
14:18:56
jackdaniel
clos might be but doesn't have to be cleaner. it is easy to do a mixin spaghetti with unobvious method invocation structure
14:18:56
phoe
as for performance, a typecase might be faster if all of your types are classes and therefore type comparison is going to be pointer equality
14:25:16
pjb
smokeink: for example, a given optimization may need to do things or generate expressions at several places, to prepare the optimization or complete it. You may need temp variables, initializations, cleanup, in addition to the code generated at the place of interest. Then you will need several functions (or methods) for a given optimization. This would exclude the typecase solution. (CLOS methods or a table managed by yourself w