freenode/#lisp - IRC Chatlog
Search
10:18:35
loke
The singapore one was really good too. I'll probbaly go to Europe and watch them again.
10:22:06
caffe
i'd also like to see jean-michel jarre someday, so i suppose europe would be necessary for making that happen anyway
10:22:53
loke
I travel to europe several times per year, and my travel time is twice as long as for the USians :-)
10:28:07
loke
That was a bit exhausting though, since I had to change flight as there were do direct flights at the time.
10:32:28
caffe
i might as well get this out of the way: i'm new to lisp. i'll try and stick to docs before asking for help here. i may inevitably ask a stupid question at some point, but i'll try and keep it to a minimum.
10:37:06
antoszka
caffe: This is really a Common Lisp channel, try the specific ones for other related languages.
10:47:34
axion
caffe: You should probably start with Practical Common Lisp if you haven't read it yet...it's free online.
10:51:22
caffe
so far, i've mostly been learning s-expression, and how to use the REPL as a calculator
10:52:01
antoszka
caffe: and I supposed most people here will suggest you stick to Common Lisp – treat elisp as a tool for configuring emacs, the dialect itself isn't very pretty.
10:52:51
caffe
yeah, i got the same impression... at first i was going to start with it, but most of its builtins(?) seem oriented towards text manipulation above all else
11:00:32
caffe
i've heard that lisp can behave either as a procedural language like c, or a functional language like haskell.. how does this work?
11:01:05
loke
caffe: It's multi paradigm. It provides imperative as well as functional facilities (and object orientation)
11:02:45
antoszka
caffe: It's just how you choose to use it. No, the object system (CLOS) is very much part of the language.
11:08:15
loke
caffe: Search for TAGBODY in this chapter of PCL: http://www.gigamonkeys.com/book/the-special-operators.html
11:09:41
antoszka
There's a nice article/rant on the presence of CLOS in CL by Naggum, but can't find it now.
11:09:53
antoszka
http://www.xach.com/naggum/articles/search?q=clos+ ← somewhere in here, I suppose.
11:11:02
loke
I have to admit that I started out thinking that CLOS was complicated and just ignored it for a while. Then I realised just how wrong I was.
11:19:45
schweers
_death: did you mean that the book shows how simple CLOS is, or did you mean MOP itself?
11:20:36
antoszka
I've had amop for a while. Was wondering if the source code of Closette is floating around somewhere to tinker with.
11:20:42
_death
schweers: the former, although the MOP springs out naturally because of good design :)
11:23:25
schweers
as much as I’d like the contrary to be true: using CL to write a program doesn’t automatically make it 'smart'
11:24:09
_death
the other day I "reversed" ql-setup::dumb-string-hash.. the result was still dumb though
11:26:29
caffe
i mostly mean in what the language or programming environment has to offer... in assembly, for example; not much is really done for you. you have to do everything yourself. C is the same to some extent.
11:27:29
_death
caffe: the thing with lisp is that you can do both low level and high level stuff as needed
11:28:19
schweers
I finally tried out CFFI the other day just to poke around in an mmap()ed region and was amazed
11:28:57
antoszka
caffe: Common Lisp is nice about being able (but not having) to control the whole compiler right down almost to the metal. You can see the disassembly of your compiled functions right in the REPL.
11:29:42
caffe
the source is very easy to read, even if uncommented... you have the same sort of live interpreted enviroment... applesoft of course is just a lot more castrated. it's a nice break from the write-compile-test-edit grind
11:33:32
caffe
yeah, the REPL is the sort of thing i've wished i had in other languages; but hadn't really seen anything vaguely similar to, sort of basic interpreters
11:34:09
schweers
its because most languages are missing the parts that make up the REPL: read, eval and print
11:34:24
schweers
altough many languages have functions of those names, they do not do the same thing
11:35:09
antoszka
caffe: Actually the REPL is *more* than just an interactive environment (like Ruby's irb/pry is, or Python's python, or Tcl's tclsh).
11:35:42
antoszka
caffe: Once you get to know lisp better, you'll see the magic symmetry between READ and PRINT (and how it actually matters something in REPL).
11:36:15
antoszka
It's one of the things that are very non-obvious for non-lispers and make Lisp a Lisp.
11:37:43
antoszka
caffe: If you want to dive right into the symbols and the reader, there's a very nice paper, google for "complete idiot's guide to common lisp packages"
11:37:59
antoszka
And don't be put off by the title, this is one most enlightening lisp paper I've read :)
11:39:46
antoszka
You'll realise how *first class* the symbols (“words” used for the code) are in Lisps.
11:40:03
schweers
antoszka: I’ve never heard of that paper, I guess I’ve got something now on my todo list now ;)
11:41:38
schweers
antoszka: 14 pages is indeed not that long, especially not in that formatting, but it’s not done in 2 minutes
11:54:04
schweers
ah, not quite true, I remember a third offering which was a consulting job in a place I didn’t want to go
12:18:21
antoszka
Yeah, there's only a handful across the world. Because other ones are occupied by lispers ;)
12:23:29
antoszka
Not sure. Most lisp jobs I've heard about in the recent years were in Europe: Portugal, Finland, UK, Spain, Berlin, Kiev.
12:29:14
schweers
has lisp been used in space travel recently? I think I once heard a war story about lisp on a probe or something, but that was ages ago, if memory serves
12:32:59
phoe
"Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience."
14:49:33
phoe
Does LOCAL-TIME provide any kind of precise timestamp difference? All I can see is TIMESTAMP-DIFFERENCE which returns a double-float, where I want an integer - seconds or nanoseconds of difference between the two timestamps.
14:50:13
phoe
Or should I create my own function for that based on subtracting two TIMESTAMP-TO-UNIX values?
14:58:20
dlowe
you'll have to create your own function for that. There's easily enough precision in a float to be precise, though.
15:02:27
phoe
I think I'll just use unix timestamp difference that will give me the difference in seconds.
15:02:33
beach
phoe: Usually, the word "time stamp" means some unique, strictly growing value, and it is usually unrelated to absolute time.
15:03:22
phoe
Oh. LOCAL-TIME uses them as values that relate to absolute time. https://common-lisp.net/project/local-time/manual.html
15:05:58
phoe
http://paste.lisp.org/display/351105 <- that's what I have so far, when it comes to describing my protocol for dates.
15:44:42
schweers
phoe: is putting a ~ at the end of each line in the docstring standard practice? I’ve never seen that before, but it seems to be a nice formatting hint.
15:51:01
beach
I use (format nil "...") and then I use ~@ at the end of lines, so that I can indent the following line for better code layout.
15:53:52
schweers
but as defun, defmacro and friends cannot be redefined, I guess the solution beach uses is quite good
15:55:17
schweers
does anyone know why standard names may not be redefined? is it for performance reasons?
15:58:16
beach
schweers: Code that uses your definition would look like normal Common Lisp code, but the symbols will be different because the package is part of the symbol, so the compiler will not attempt to optimize for those.
15:59:29
schweers
beach: now that I know that is legal I know how that works, although I have to admit that I don’t have that much experience with how the reader treats packages
16:01:08
beach
If the reader sees a symbol without a package prefix, it interns it in the package that is the value of *PACKAGE*.
16:04:45
schweers
beach: that is also not quite true, as the symbol `defun' is not interned into my current package, although it has no package prefix. It is only interned into the current package if it is not interned "anywhere else where it is visible"
16:06:52
schweers
when I implemented my subset of the common lisp reader I skipped the whole package thing
16:07:44
beach
"If a symbol whose name is the same as string is already accessible in package, it is returned."
16:08:45
schweers
sadly common lisp package and symbol semantics are not implementable in elisp. At least I couldn’t find any way
16:09:29
beach
schweers: So what I said was true. It does intern it in the current package. However, "intern in the current package" takes used packages in to account through the definition of "accessible".
16:09:59
schweers
well, you said that it happens when there is no package prefix, which is not true by itself :-P
17:05:31
kencausey
I seem to be missing something basic regarding quicklisp. Once I have install some systems end the day, and come back the next day, what is the method for using the systems again? I'm on sbcl Windows. It doesn't seem that sbcl or asdf are aware of the quicklisp paths although quicklisp is loaded (via quicklisp/setup.lisp).
17:10:11
phoe
schweers: exactly what Bike said, I feed this to FORMAT without arguments so I get my line breaks erased for free
17:10:43
kencausey
And I guess while we are on the subject: Does ql:update-all-dists just update the package list or also update previously loaded packages?
17:11:26
kencausey
And I guess the way quicklisp currently works new versions don't actually appear until Zach (or whoever is doing it these days) manually issues the update (roughly monthly?)
17:11:48
Xach
kencausey: the update updates the package list and fetches the latest versions of whatever you had installed.
17:13:35
Xach
beach and/or jackdaniel -- http://report.quicklisp.org/2017-07-17/failure-report/mcclim.html#mcclim_extensions
17:21:01
Xach
and http://report.quicklisp.org/2017-07-17/failure-report/mcclim.html#mcclim-raster-image
17:25:34
jackdaniel
I'll have to add a test for loading all systems separately for mcclim (and simplify the dependency tree), because these errors are quite regular
17:51:08
phoe
"This generic function implements the behavior of the slot-value function. It is called by slot-value with the class of object as its first argument and the pertinent effective slot definition metaobject as its third argument."
17:52:02
phoe
by the broad definition, an accessor is just a function that retrieves or stores data.
17:52:19
Bike
beach: we have, but i'm observing different behavior from an accessor and from s-v-u-c, so i'm adrift
17:53:01
Bike
no, no, i mean i tried some stuff and calling setf slot-value directly does things that setf accessor does not
17:54:26
beach
That is one thing that should not be possible, unless those other things are defined by the implementation only and not generally available to the application programmer.
17:55:54
Bike
cool. just means there's some obscure bug in sbcl with method redefinition, or something
17:55:57
beach
If everything is MOP defined: The class metaclass, the class of the generic function, the slot metaobject, etc., then the accessor may avoid calling slot-value etc.
17:57:24
nosefouratyou
hey I am trying to fix up logv at the moment and I am getting stuck on this issue: https://github.com/nallen05/logv/blob/master/logv.lisp#L31 https://gist.github.com/nosefouratyou/24d444ebe831612192f75f1c3e67f33a
17:57:52
beach
Bike: I am not talking about custom classes and custom methods. I am talking about custom metaclasses and custom method classes.
17:58:43
beach
If all you have is custom methods on custom classed, but the metaclasses are standard, then the slot accessor may avoid calling slot-value-using-class if it is the only applicable method.
18:00:39
beach
That's fine, and in cases like that, the slot accessor may not be able to avoid calling slot-value-using-class.
18:05:16
nosefouratyou
but I had it running today; I removed in and downloaded it again and now I can't figure out what I did to fix it
18:08:25
Thetabit
I'm sure this is dumb, but I am going thru the Slime manual looking at the commands for debugging, but I don't know how to start the debugger without hitting an error first. How do I get into the debugger and then step into the expressions? Am I approaching debugging with the wrong mindset, eg treating emacs and slime like an IDE where I can set breakpoints?
18:08:28
Bike
i'm pretty sure. from the package definition that's cl:defsetf, and defsetf has a defsetf lambda list, and those don't have that list thing.
18:08:47
Bike
Thetabit: it is a bit unusual to do it like that. but you can insert calls to (break) in your code
18:08:48
nosefouratyou
Thetabit: you can use (break) anywhere in your program to trigger the debugger
18:09:29
kencausey
nosefouratyou: Actually, I don't see logv listed in quicklisp currently, I may have misspoken. Is your quicklisp out of date?
18:10:24
Bike
nosefouratyou: try making it optional. (key &optional (log-env-name *default-log-env*))
18:10:29
Xach
https://sites.google.com/site/sabraonthehill/comparison-of-lisp-logging-libraries has some hints
18:10:39
Xach
>> I do want to mention that I have left out at least two. First, logv, which I could not get to compile.
18:11:50
Bike
logv doesn't show up in system-apropos. maybe you have it otherwise accessible from asdf, like from quicklisp local-projects.
18:54:07
phoe
But it looks like I can compress and decompress arbitrary Lisp uint8 vectors, which is good.
18:55:38
phoe
The best part - I needed to build the .so library for Linux myself because the original LZMA makefile from Igor Pavlov only builds binary executables.
19:30:36
phoe
tetero: working out, as in? It works for me so far for trivial arrays, I have not tested it much yet, it's freshly out of the oven