freenode/#lisp - IRC Chatlog
Search
10:25:09
aeth
It's a build file, so it's an arcane recipe you copy from the last time you used it, or if you haven't made one yet, you copy someone else's. No one knows how the first build file for any build system was written.
10:26:15
aeth
To load a local one, it needs to be recognized in ~/quicklisp/local-projects/system-index.txt, usually by having the parent directy in or symbolically linked in ~/quicklisp/local-projects/
10:58:54
libertyprime
aeth: cool. i have loaded a package, but am unsure now how to get the function definitions into a lisp repl
11:11:41
beach
If you have loaded your system, then the functions are defined in the system that is running the REPL.
11:11:43
splittist
libertyprime: as you will see from the top of the cl-expect file, the symbols in that file are defined in the CL-EXPECT package. You can access them by prepending the package-name to the symbol you want, like CL-EXPECT:CREATE-THING. (Assuming CREATE-THING is exported from that package.)
11:14:17
splittist
libertyprime: you can switch the repl to read in the CL-EXPECT by using (in-package #:cl-expect)
15:21:13
d4ryus
jmercouris: note that if you recompile print, fish wont change. (guess thats obvious?)
15:24:15
Bike
recompiling creates a new function object and assigns the name to it, while fish will still have the old function object.
15:24:30
d4ryus
for that to work would need something like (setf (fdefinition 'fish) (lambda (&rest args) (apply print args)), hence you set fish to a function that looks up the funtion of symbol print and calls it
15:26:56
pjb
d4ryus: the rule is that functions in the CL package cannot change, and that the compiler can "inline" them.
15:27:06
d4ryus
As Bike said, its obvious if you look at code like (let* ((x 1) (y x)) (setf x 3) y) returns 1 and you wouldn't expect it to return 3, obviously.
15:27:53
tcr
jmercouris, it uses &body there to make Slime (and other development environments) as an indentation hint
15:28:12
pjb
d4ryus: on the other hand, in the case of all the other functions, they could indeed be redefined, and then you want to choose whether you want to follow the redefinition or not. Often, you don't want to! So using the setf fdefinition fdefinition is the right thing to do.
15:28:17
Bike
"Destructuring allows a macro lambda list to express the structure of a macro call syntax. If no lambda list keywords appear, then the macro lambda list is a tree containing parameter names at the leaves"
15:28:32
pjb
d4ryus: this is the same thing with using function objects vs. using function name (the symbol).
15:29:24
pjb
d4ryus: for example, in general when definining reader macros, I use the function name, so I can easily redefine the reader macro (for some characters, if you botch your reader function it can be difficult to redefine (read) it).
15:32:54
d4ryus
jmercouris: Baggers has a video on destructuring-bind ('Little bits of lisp - destructuring bind' on youtube)
15:34:00
Bike
it means the lambda list can be structured like a macro call is. like, consider making your own macro that just duplicates let. you'd use it like (mlet (binding1 binding2...) body...). so you could (defmacro mlet ((&rest bindings) &body body) ...)
15:40:35
jmercouris
this: (defmacro serapeum.exporting:defclass (name supers &body (slots . options))
15:40:53
jmercouris
means it expects a list of at least 2 elements, with a varied amount of elements after of the form of a dotted pair
15:41:39
Bike
(slots . options) is exactly equivalent to (slots &rest options), like i said earlier.
15:42:06
Bike
"A destructuring lambda list (whether at top level or embedded) can be dotted, ending in a parameter name. This situation is treated exactly as if the parameter name that ends the list had appeared preceded by &rest. " in the page i linked.
15:44:07
pjb
jmercouris: (foo . bar) is a cons cell. A list such as (a b c d) is also a cons cell!!! It's (a . (b c d)). So you can match the two cons cells, and identify foo = a, and bar = (b c d). Therefore you can see that (foo . bar) is equivalent to (foo &rest bar).
15:52:05
sjl_
One thing that's mildly annoying that I run into: I often want to have a name-and-options parameter for a macro that's used like this: https://hg.stevelosh.com/chancery/file/tip/src/chancery.lisp#l224
15:53:06
sjl_
I could embed the destructuring (name &key foo bar baz) into the lambda list, but then callers wouldn't be able to give a bare symbol to mean a name with no options
15:54:04
sjl_
So either I embed the (name &key ...) into the lambda list, which is less code and more obvious for users when your editor shows you the lambda list as you type
15:54:41
sjl_
Or I do an opaque name-and-options in the lambda list, then (destructuring-bind (name ...) (alexandria:ensure-list name-and-options ...)) in the body
15:58:27
jackdaniel
sjl_: I've seen that some some lisps (by some I mean allegro and genera, possibly more) recognized a declaration for arglist
16:00:46
jmercouris
I'm sure there is a way by looking through all symbols, but I meant some idiomatic way
16:01:23
Bike
keep in mind this is direct specializations, so it won't get any methods specialized on a subclass
16:03:40
_death
sjl: there is a start of a mechanism for "enriched arglists" in slime (see contrib/swank-arglists)