freenode/#lisp - IRC Chatlog
Search
1:00:29
ealfonso
thanks Bike makomo . I wanted to try it myself, and was only missing the (return-from ) and the named loop tag. https://pastebin.com/g3B3bidW
1:55:33
skidd0
Hello all. Quick question regarding packages and systems with asdf and quicklisp coming up.
1:56:19
skidd0
I have a package.lisp that exports two classes from my project.lisp along with a project.asd that defines the project's system
1:57:45
skidd0
but, when i try to then (make-instance 'class-in-project), i get an error that says the class symbol doesn't exist in common-lisp-user
2:08:30
Xach_
inheritance is done with use-package or :use in defpackage (it must be external in the source package)
2:09:05
Xach_
use-package isn't something you'd use normally - it's more typical to use defpackage to set things up.
2:12:35
Xach_
yes. but import has a bit of an issue where it doesn't matter if it's external. in theory you should import only external things. i'd like an import-if-external or something sometimes.
2:12:54
Colleen
Unknown command. Possible matches: 8, time, set, say, mop, get, login, grant, tell, roll,
2:16:32
simplegauss_
is there a standard way to create callable objects or (equivalently) add some annotation to a function object so that it can still be called by funcall?
2:18:51
simplegauss_
i've actually seen that, but i don't think that's standard, and moreover have no idea how it works (as in I can use it, but I have no understanding of the link between funcall and MOP).
2:18:58
simplegauss_
here is a working example: https://clos-mop.hexstreamsoft.com/concepts/#funcallable-instances
2:19:51
simplegauss_
is there a specification for how funcall actually works in the standard? my main reference is the hyperspec and as far as I can tell it makes no mention of anything to do with the mop
2:21:27
simplegauss_
Bike: i wanted something closer to the standard. i guess it doesn't really matter in practice, but it makes me uneasy that I don't have an understanding of how it works.
2:22:16
simplegauss_
is there a free way to learn about MOP? something like the hyperspec? it seems AMOP is only available for purchase
2:24:43
simplegauss_
Xach_: true :) really all i would need is a generic "funcall" that works on functions and on objects inheriting from a certain class, but that seems uglier and more invasive than using the existing MOP solution.
2:27:41
simplegauss_
Bike: what i'm confused about is, for example, I can't find in the spec you linked how funcall is modified, and this is the sort of thing i'd like to understand. do you know if that sort of info is in AMOP? if so I can try and get it from the library
2:28:38
Bike
it's just specified that if you try to call a funcallable-standard-object, it calls that object's funcallable-instance-function instead
2:30:48
simplegauss_
Bike: but the point is I can't make a "funcallable-simplegauss-object" that doesn't inherit from "funcallable-standard-object" but still works with funcall/apply, right? it just seems like a weird special case in the design.
2:32:10
Bike
you need the metaclass because the objects have an additional semi-slot for the function, which is reflected in the class
2:33:08
Bike
in the standard you can't define objects that aren't instances of standard-object, or classes that aren't subclasses of standard-class, just by design
2:36:10
simplegauss_
so historically CLOS came before and separately from the MOP infrastructure, or they were created concurrently but only certain parts made it into the standard?
2:45:31
simplegauss_
more generally, i have a (mostly academic) interest in the tradeoffs of polymorphism the CLOS/MOP vs typeclass (pioneered by Haskell) way. it seems that in practice the only deficiency of CLOS is return-type dispatch (which would be quite difficult in lisp :))
2:46:43
Bike
generic function calls will also involve a runtime dispatch cost that i believe haskell can avoid.
2:47:45
simplegauss_
I guess there's also the ML modules way, but that seems just a few macros away :)
2:48:47
simplegauss_
Bike: you might be interested in https://github.com/guicho271828/inlined-generic-function
2:49:52
Bike
the basic idea is that it implements CLOS using itself, and exposes some of the generic functions therefore involved.
2:58:16
ealfonso
let's say I want to split a single-package containing some utils into a utils and a 'core' file. defs in the 'core' file depend on defs made in util. do I need to put (defpackage ) in util?
3:32:03
rpg
ealfonso: Often handy to put defclass, defmacro, defvar, defparameter forms in decls.lisp, which depends on package.lisp and then have everything depend on decls
5:56:38
jack_rabbit
shared libraries have certain calling conventions. All the lisp has to do is adhere to those and it's all good.
5:57:12
jack_rabbit
The functions and objects exposed by the library are made visible through an API.
8:42:45
White_Flame
so I'm trying to join #lispweb and it says "Cannot join channel (+r) - you need to be identified with services", yet I am identified. Is freenode still having problems?
8:43:18
White_Flame
in any case, are there any examples of using hunchensockets with sec-websocket-protocol?
8:43:46
White_Flame
the code in the implementation looks like an unexposed hack, but without being documented as such
12:30:43
xificurC
http://ix.io/1d5U/lisp - cli-arglist works fine when called in the REPL but the macroexpansion produces (&key). I guess that's because '(...) gets into clidef as (quote '(...)). What would be the solution? I am quoting the clidef because I want to be able to do `(:options (,@common-options (special #\s "special option" :flag)))
12:34:15
xificurC
I often have this issue, I have a list that I want to be able to build at runtime and use that list in a macro. If I leave out the quoting then I cannot write lisp code, I just turned that piece into pure data. If I put a quote there I don't know how to use that piece of code in a function call - ,(func arg) where arg went in as '(1 2 3) and now is
12:35:12
White_Flame
rumbler31: it's a websocket option to tell the server which user protocol you want to use inside your messages
12:39:12
White_Flame
in order to deal with runtime data, macros should output code to handle runtime data
12:40:23
White_Flame
for instance, if you're trying to do a mapcar on a runtime list, you don't have that list at compile-time; you need to generate the mapcar code that will take the runtime list
12:44:24
White_Flame
usually it's just passthrough stuff for body; they pretty much never are written to destructure into quoted fields
12:46:59
xificurC
White_Flame: I would hope not :) I'm building a library for handling command line. What I pasted is a piece of the puzzle. Basically I want to write '(:name "foo" :args ((file ...)) :description "makes some foo" :options ((down #\d ...) (create #\c ...)) to get a function (lambda (file &key down create) ...) that will be able to handle a command li
12:49:45
xificurC
White_Flame: ok, if I take the quote off, how do I (defcli foo) and (defcli bar) both sharing (defparameter *common-options* '((help #\h "prints this help" ...) (verbose #\v "prints debugging information to stderr" ...)))
12:50:59
White_Flame
the very first thing you need to do is figure out what your generated code should be
12:51:46
White_Flame
you also need to ensure that your defparameter value is available at compile-time