freenode/#lisp - IRC Chatlog
Search
23:21:13
pillton
Bike: Would copy on write work to solve the sharing of objects across environments?
23:32:54
pillton
Is it not a good idea to maintain a link between the lexical variable and the current global environment in situations like (let ((x 1)) (defun example () (incf x)))?
0:19:24
ealfonso
how does a recursive macro work, is it dynamically expanded at runtime? I wrote a macro to retry an arbitrary form up to n times, retrying in case of a condition signalled. the problem is that n is not known at compile time
0:21:54
ealfonso
so currently I wrote a macro using loop, so it's not a recursive macro. the problem is that I'm storing the result into a variable, and forms that return multiple values don't seem to work correctly
0:22:19
Bike
(defun retrying (n thunk) (tagbody loop (handler-bind ((error (lambda (c) (declare (ignore c)) (go loop)))) (funcall thunk))))
0:37:08
Bike
establishing a bunch of blocks, including one named NIL, aorund arbitrary code is kind of bad though
0:38:46
makomo
Bike: because the blocks don't use gensym'd names, or because it's just complicated/bad style?
0:40:20
ealfonso
i'm trying this, https://pastebin.com/B68fQy5P => "return for unknown block: #:|loop-tag823|"
0:41:17
makomo
Bike: so what stndard looping construct is there that doesn't establish a NIL block? is there one even?
0:50:05
makomo
Bike: then i lose the ability to differentiate between exceeding and succeeding though, no?
0:50:19
makomo
i mean, currently i don't differentiate via the return value in any way, only in "Exceeding" being printed
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