freenode/lisp - IRC Chatlog
Search
0:15:10
travv0
you sure that's what's written to the stream and not just your repl printing the return value?
0:55:37
npfaro`
Of all the knobs here http://clhs.lisp.se/Body/f_wr_pr.htm i'm not sure which one to use to get that sort of thing
1:01:09
ralt
loke: I've seen in some logs that you managed to get signals from dbus, would you care to share some snippets to do this? I want to subscribe to a known signal but unclear what I'm supposed to do.
2:46:43
npfaro
i don't know if that's the best way haha. if anyone else has a better idea please chime in
3:00:27
Alfr_
martinjungblut, careful if list has a odd number of elements, then on the last iteration b will be nil; just keep that in mind that it won't error.
3:00:35
aeth
destructuring bind will force an error, unlike LOOP's destructuring, but it's not as elegant. (loop for sublist on '(1 2 3) by #'cddr collect (destructuring-bind (a b &rest rest) sublist (declare (ignore rest)) (cons a b)))
3:01:27
martinjungblut
as a newcomer, I have to say, Common LISP is a hell of an environment to write software in
3:04:03
aeth
Oh, and there's an in between route, which is to do the sublist thing, but then destructure it in the next LOOP variable instead of having local d-b variables.
3:16:21
npfaro
is there any way to convert a number into a list of bytes without manual bit shifting
3:25:21
npfaro
Is there any better idiom for an increasing counter in loop than (loop for i = 0 then (1+ i))
3:26:34
specbot
The for-as-arithmetic subclause: http://www.lispworks.com/reference/HyperSpec/Body/06_abaa.htm
3:54:13
emaczen
What is the the timezone in encode and decode universal-time? I don't see a description in the docs
4:01:49
Bike
"time zone n. a rational multiple of 1/3600 between -24 (inclusive) and 24 (inclusive) that represents a time zone as a number of hours offset from Greenwich Mean Time. Time zone values increase with motion to the west, so Massachusetts, U.S.A. is in time zone 5, California, U.S.A. is time zone 8, and Moscow, Russia is time zone -3."
4:08:34
Bike
if you look at the bottom menu on clhs pages, the glossary is there between "symbol index" and "x3j13 issues"
4:48:43
beach
I am doing very well thank you. I am currently working on updating the SICL specification to adapt it to the many new ideas and extracted libraries that have happened since last time I worked much on it.
8:02:05
npfaro
((:TRANSLATIONS ((:TRANSLATION . "Do you think that's a good thing to do?"))) (:WORD--COUNT . 7) (:CHARACTER--COUNT . 17))
8:07:38
npfaro
i can't seem to find a predicate for it, so should i just make a substring and check that
8:13:20
beach
npfaro: Perhaps it is unorthodox because most languages don't allow keyword arguments to modify the behavior, and they don't allow "out of band" return values.
8:14:10
beach
npfaro: Lots of things about Common Lisp are that way, luckily. CLOS, the condition system, macros, keyword arguments, multiple values, etc.
8:18:02
npfaro
The only issue is that mismatch returns nil when the arguments are equal, so (zerop (mismatch ...)) breaks when they're equal
8:18:09
beach
It's a bit sad, though, that the intrinsic limitations of other languages would make them "orthodox".
8:21:26
loke[m]
Can't you do something like (NOT (MISMATCH s1 s2 :end1 #1=(min (length s2) (length s2)) #1#))
8:22:33
Nilby
In my own far off world that matters little, I say begins-with and ends-with, because I find the mismatch and search forms unintuitive.
8:25:03
loke[m]
beach actually I meant NOT, because the CLHS specifically says that MISMATCH returns “false”
8:26:09
beach
Note to self: In WSCL, consider specifying that MISMATCH returns NIL as a default value.
8:26:35
loke[m]
I think it makes sense. MISMATCH is a predicate function that also happens to return a useful value when returning true. :-)
8:27:57
loke[m]
Speaking of nil, I saw someone complaining about the terms NULL and NIL. He suggested a compromise: NILL
8:32:27
beach
It may have been the case that you could fit 6 characters in a 36-bit word at some point.
9:52:09
pve
Hi, I'm thinking about how to organize the compilation order of my program. Is there an easy way to tell ASDF to load a file A from source (to get some basic functionality) then compile and load some other files to extend the functionality and finally compile and reload file A to ensure that the fasl is built with the full functionality?
9:56:50
arora
I am new to lisp, my university professor suggested to learn it for AI course, what's a good way to start?
9:59:38
beach
arora: Most AI today is based on "deep learning", but for traditional AI, Common Lisp is both faster and more expressive than Python.
10:00:30
minion
arora: PAIP: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp
10:02:18
minion
arora: 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).
10:02:57
arora
Python has libraries like sklearn and numpy which makes AI easier, what does lisp have as equivalent?
10:03:46
beach
arora: I don't know what those libraries do, but some others here might. Not many people here use Common Lisp for AI-like stuff.
10:06:22
arora
beach: Yea that's what I thought too, I hadn't heard of Lisp being used for AI before
10:06:54
TMA
arora: From what I understand, those libraries are just python wrappers over some C and Fortran libraries. The wrappers are necessary, because python by itself is too slow for any kind of numerical computation.
10:06:56
moon-child
lisp was traditionally used quite a lot for ai. The creator of lisp was also the coiner of the term 'ai'
10:08:18
arora
TMA: but since a lot of people use them in python, it became the "standard" of doing AI
10:11:49
TMA
arora: This is less necessary with Common Lisp compilers that produce fast native code. However, the utility of libraries goes beyond any speedup, they reduce the amount of work a programmer is required to perform. There are Common Lisp libraries for numerical computations, for GPU interfacing, and others that can help you.
10:13:00
edgar-rft
AI in the 1970s meant "Artificial Intelligence", AI in 2021 means "Anal Intercourse"
10:13:17
TMA
arora: It used to be so that Latin was the language of science. Fashion changes. Python is now considered fashionable whereas lisp is thought of as démodé.
10:14:57
arora
I had people in my class talk bad about lisp because it does like a prefix notation of computation, like 5 + 2 = + 5 2
10:16:48
arora
since its quite different from the other languages, I dont see how its useful either, why does lisp have a different notation?
10:17:00
edgar-rft
Lisp indeed helped me to understand math better because I do not need to learn stupid precedence rules.
10:17:23
beach
arora: The term is "homoiconicity" and it lets the programmer manipulate programs as data more easily than other notation.
10:18:36
beach
arora: But Common Lisp macros represent a powerful extension mechanism that is made easy with homoiconicity. Other language users have to wait for the updated standard for similar extensions.
10:22:09
logand
common lisp macros are great, but should be used sparingly. it is much easier to use a function at compile time by wrapping it in macro as opposed to using macro at runtime by wrapping it in funcall+compile+backquote+lambda
10:22:34
beach
Yes, but that's not how it is used very often. Instead, it is used in macros, so that the macro function (which is just code) can generate new code from some input code.
10:23:50
beach
arora: In Common Lisp, the same language (i.e. Common Lisp) is used to manipulate code as the one used to manipulate other data.