freenode/#lisp - IRC Chatlog
Search
17:51:00
makomo
beach: "When a generic function or any of its methods mentions &key in a lambda list, the specific set of keyword arguments accepted by the generic function varies according to the applicable methods."
17:51:04
specbot
Keyword Arguments in Generic Functions and Methods: http://www.lispworks.com/reference/HyperSpec/Body/07_fe.htm
17:51:35
makomo
"The set of keyword arguments accepted by the generic function for a particular call is the union of the keyword arguments accepted by all applicable methods and the keyword arguments mentioned after &key in the generic function definition"
17:54:41
makomo
or would that whole section of the standard only apply in the case when we have a &key in our GF
18:10:35
littlelisper
i want to get the modification time of a file. is there any library for it? i googled but no help
18:21:28
makomo
if i'm writing a DSL and want my macros to be indented nicely, what are some general tricks or ways to structure these macros to make this happen
18:22:14
makomo
"here" is where is how i want the process code to be aligned, "not-here" is what i don't want
18:24:47
_death
I assume you're asking about the editor (emacs+slime) indenting it.. there's trivial-indent, but for more complicated macros you could patch cl-indent or otherwise write elisp code to do it
18:42:11
_death
you can import specific _symbols_ from a _package_ using :import-from in your defpackage form
18:46:02
pjb
(defparameter *my-fun-package-foo* (list (function sin) (function car) (function cos)))
18:46:29
pjb
(defparameter *my-fun-package-bar* (list (elt *my-fun-package-foo* 0) (elt *my-fun-package-foo* 2)))
18:46:48
pjb
So you have "imported" the first and third function from *my-fun-package-foo* into *my-fun-package-bar*.
18:47:15
pjb
CL packages only deal with symbols, not with functions or variables or types or whatever the symbol is used to name.
18:49:09
pjb
littlelisper: on the other hand, you may not care if the symbols used to name your function also name types or slots or variables or whatever.
18:49:56
pjb
It also helps that global variables are special, therefore they are named with *stars-around*, and functions usually no. (even if some functions may be named with one or two postfix stars, like, f, f* and f**).
18:50:44
pjb
On the other hand, it occurs often that you have both a type and a function using the same name: (typep (vector 1 2) 'vector) (typep (list 1 2) 'list) etc.
18:56:13
_death
(defpackage "AI" (:use "COMMON-LISP") (:export "THINK")) (defpackage "PERSONALITIES" (:use "COMMON-LISP") (:import-from "AI" "THINK") (:export "THINKER")) (in-package "PERSONALITIES") (defun thinker () (loop (think)))
19:00:25
warweasle
_death: I was hoping the singularity would hit today. I don't trust people to run things anymore.
19:03:10
_death
warweasle: the last time I hoped for a singularity event was when I waited at some hospital queue (for a routine check) while the secretaries went superslow
19:04:07
MichaelRaskin
_death: let me assure you that it is in fact possible to intentionally program AI to maintain unacceptably slow speed of the queue
19:08:14
aeth
If I compile a random program, I can tell you without looking at anything but htop if it's C++ or not.
19:16:08
aeth
I'm not sure why people say SBCL takes a long time to compile or otherwise list its compile time as a disadvantage. (1) you only ever see that when you update QL and (2) it doesn't take very long, and this is even with only one core being used
19:16:50
aeth
Well it's generally either very quick or an infinite loop bug, but, yes, you can put anything in compile-time
19:18:09
aeth
Bike: you generally only see everything being compiled when you ql:update-all-dists afaik.
19:20:48
aeth
Bike: The only thing that seems to be noticably slow in the entire compilation process is cl-sdl2 and that's probably because it uses autowrap
19:22:04
Bike
the level of confidence you put into your assertions really doesn't match the evidence behind them
19:27:08
aeth
Just under 3 seconds to build the largest thing that I've written in CL, which is about 7k lines of code, and it has one slow file because of an elaborate data structure.
19:30:59
aeth
Let's say 2.8 and let's say it's directly related to LoC. 7k in 2.8 seconds is 2.5k a second. (/ 60d3 2.5d3) would then be 24 seconds. Actually sounds fairly plausible.
19:31:48
aeth
My computer could be twice as fast as yours and/or your files could be more elaborate at compile time.
19:36:49
scymtym_
i halved SBCL's ironclad compile time some time ago. and this weekend, stassats halved it again
19:39:19
aeth
Of course, kloc/s probably isn't the best measurement when you can do so much at compile time.
21:38:47
pjb
varjagg: (setf (sexp-file-contents "user-token.db") '(("pjb" . "DEADFACE") ("varjagg" . "12345678")))
21:43:52
pjb
Again, depending on the number of processing acessing the data, the size of the data etc.
21:45:44
aeth
When CL is popular enough, it might even add s-expressions to its storage next to JSON and XML and whatever else.
21:48:58
aeth
PostgreSQL is definitely the way to go, though. Perhaps via postmodern. https://github.com/marijnh/Postmodern
21:50:28
aeth
mySQL is for performance or ubiquity, SQLite is if you want to embed a SQL database, and noSQLs (including random CL-based storage systems) aren't a good fit for the problem.
22:16:16
aeth
It's possible that they make it require nickname registration to prevent being hit by the spambot that floods freenode from time to time
22:34:18
edgar-rft
noobly: #emacs was locked for users with non-registered nicks a while ago because too much spam.
23:11:04
MoziM
is there an elisp function that can change all the values of a property in a nested plist? this is an example of what i'm trying to navigate through, i want to set all :background properties to "black" http://termbin.com/9j5o
23:44:59
karlosz
it seems that converting to hir takes 2 out of the 10 seconds it takes to compile alexandria
5:11:05
beach
asarch: I would like to know the specific feature you are looking for that you can't already do in CLOS.
5:21:50
beach
asarch: (defgeneric show (water)) (defmethod show ((water chocolate)) (format ...)) (defmethod show ((water coffee)) (format ...))
5:22:36
beach
asarch: And can you tell me what a "virtual function" allows that a generic function does not allow?
5:28:37
asarch
As you already know, virtual functions actually helps C++ to do the polymorphism stuff
5:29:46
beach
asarch: So the simple answer to your question is "no". But that doesn't mean that you can't do the things you can do in C++. It might mean that you don't need a special mechanism in CLOS whereas you do in C++.
5:30:10
beach
asarch: Which is why I wanted to know what particular characteristic of virtual functions you were looking for.
5:31:50
beach
For the record, I really dislike questions asked that way, i.e. "Does Common Lisp have the equivalent of the <mumble> feature in the <foo> language"? It presumes that 1) everyone knows the <foo> language. 2) that if <mumble> does not exist in Common Lisp, then Common Lisp is somehow inferior.
5:32:48
beach
I much prefer "What mechanism in Common Lisp would you use to solve the following problem...".
5:35:14
asarch
I guess that is the easiest way to ask things: "Can you do overload functions in Lisp?"
5:36:17
beach
"overloading" is typically a compile-time mechanism, whereas "generic dispatch" is a run time mechanism, so much more powerful.
5:38:27
loke
asarch: “overload” menas that you can have several functions with the same name. It does not imply that the choice of which implementation to call is actually chosen at runtime.
5:39:08
loke
asarch: In C++, if you have two functions: void foo(int) and void foo(char), that's overloading.
5:39:31
loke
asarch: But for the compiler to be able to choose which function to call, you have to know the type at runtime.
5:39:33
beach
asarch: Consider a method FOO in some language like Java or C++. It has two signatures, each with one argument. One signature has a DRINK argument and another has a COFFEE argument (COFFEE is a subclass of DRINK). Now do a DRINK d = new(COFFEE) and then x.FOO(d).
5:39:49
asarch
I thought: (defgeneric show (caffee) ()) and (defgeneric show (chocolate) ()) was actually the same :-(
5:41:06
loke
asarch: Here's another terminology tip for you: In C++ a “method” is a function that is attached to a class. In CLOS, a “method” is some actual code that _may_ be run when a generic function is called. The method is attached to the generif cfunction,. not to a class.
5:42:01
beach
asarch: So which method would be called in my example? The one with a DRINK argument, or the one with a COFFEE argument?
5:43:18
loke
Beach's statement sounded weird, until I replaced the word Drink with Beverage in my mind. :-) (drink being both a noun and a verb made me confused. I'm stupid :-) )
5:45:02
asarch
I was actually reading the pages of the CLOS book from the "Object-Oriented Programming in Common Lisp" book from Sonja E. Keene