freenode/#lisp - IRC Chatlog
Search
20:59:28
markasoftware
package names don't logically seem like keywords to me, since they're user-defined
21:01:07
markasoftware
package names logically refer to something, not just to themselves -- they represent a package
21:02:44
White_Flame
if they were always keywords, it would save a bit of space, compared to all packages which reference it by name interning their own 'SYMBOL
21:03:29
White_Flame
although that doesn't pollute your own package, it does take up that bit more of space :)
21:05:11
pjb
markasoftware: you're perfectly right. package operators take string designators. You can as well pass strings.
21:06:02
dmiles
a reason some peopel dont use strings is they are unoffically case sentitive for pakcage names
21:06:28
pjb
makomo: compare with (defpackage :while (:use cl) (:export :while)) (use-package :while)
21:07:36
pjb
White_Flame: which would be a bad move, since you couldn't use "MyPackage" as package name.
21:08:27
pjb
(defpackage "MyPackage" (:use :cl) (:export :foo)) (list MyPackage:foo ) #| ERROR: There is no package named "MYPACKAGE" . |#
21:09:46
pjb
Nope. Most languages are case sensitive. The only language that is not AFAIK, is Chinese.
21:10:49
White_Flame
yeah, packages are a bit confusing at first, usually because the same name "package" means different things in other languages. Here in CL, a package is literally a namespace, only affecting symbols
21:24:34
Bike
the type system isn't restricted enough to allow the way normal method dispatch works.
21:24:37
pjb
Bike: well, the not really comes from the fact that testing for satisfies doesn't necessarily call the satisfying function.
21:26:03
remexre
how, then? I'm currently doing (defmethod foo (bar (baz (satisfies quux))) ...), but CCL throws an error at this
21:26:50
Bike
methods dispatch on EQL specializers (eqling a particular object) or classes, and satisfies types aren't classes.
21:27:03
Bike
you could extend the system to dispatch more generally, but then you lose a lot of properties of clos.
21:30:36
remexre
I'm using (eql) in other places and need to be able to keep adding more (eql) variants
21:35:11
Bike
a lot of clos's rules are about being able to translate a network of subtype relationships into a line, the class precedence list.
21:36:22
Bike
satisfies types are completely arbitrary, which means they can overlap in disorganized ways. worse, figuring out the subtype relationship at all is impossible.
21:39:42
Bike
i think there is actually a bias against &optional in new code. maybe only a little, though.
21:46:15
pjb
remexre: now of course, if you have a lot of methods, you may want to be more efficient in find-predicate-dispatch-method. eg. you can use a tree instead of a list. or a tree of hash-tables, etc.
22:05:42
didi
Curious limitation: the size of a byte is unchangeable after the stream has been created.