jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
Stanley00 has joined #lisp
frost-lab has joined #lisp
mfiano has joined #lisp
Stanley00 has quit [Ping timeout: 268 seconds]
gaqwas has quit [Ping timeout: 272 seconds]
pankajsg has joined #lisp
kam1 has joined #lisp
duuqnd has quit [Remote host closed the connection]
kam1 has quit [Read error: Connection reset by peer]
rpg is now known as rpg_away
kevingal has joined #lisp
kevingal has quit [Remote host closed the connection]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kaftejiman has quit [Remote host closed the connection]
daphnis has quit [Ping timeout: 260 seconds]
surabax has quit [Quit: Leaving]
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
hugh_marera has quit [Ping timeout: 240 seconds]
imode has joined #lisp
Steeve has quit [Quit: end]
pfdietz has quit [Ping timeout: 245 seconds]
dbotton has joined #lisp
wxie has joined #lisp
<dbotton> When creating a class, does one need to export every method/generic function? Is there any short cuts?
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
sm2n_ has quit [Ping timeout: 256 seconds]
<dbotton> Currently I am just adding an (export 'some-method-name) before any method I want exported.
<no-defun-allowed> You export every name you want other packages to be able to use.
<no-defun-allowed> You don't need to export method names, as those are just names of generic functions.
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 246 seconds]
entre-parenteses has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<dbotton> If I use the implicit generic though would. Is there any reason specifically for create a generic for a simplistic method? It seems like a duplication of code outside of documentation (which in my purpose detracts not adds)
lucasb has quit [Quit: Connection closed for inactivity]
<no-defun-allowed> I'm afraid to ask why documentation detracts from your work.
<dbotton> The opposite my works is heavily documented, it actually would detract to add another doc point.
<dbotton> I am documenting the methods which are picked up in the docs generated my mgl-pax
jeosol has quit [Remote host closed the connection]
<dbotton> If I added the generics just adds superfluous info
<no-defun-allowed> Well, you usually add a generic function, and put the documentation there.
<no-defun-allowed> i.e the generic function documentation tells you what it does, and if you have method documentation, it describes how you do it.
<dbotton> Ok, thanks
<dbotton> The generic though would not per se be connected to the class? Is there a way to someone say this generic is in this part of a call hierarchy and bellow?
Misha_B has quit [Ping timeout: 264 seconds]
<dbotton> (Hope that makes sense_
<Alfr> dbotton, generic functions and methods don't belong to classes.
<dbotton> Yes I know in Ada and Lisp there is a type and they act on that type, but never the less
<Alfr> dbotton, okay you didn't use "belong", but that association is quite ... lose.
<no-defun-allowed> Methods belong to generic functions, not to classes.
mbomba has quit [Quit: WeeChat 3.0]
<dbotton> Understood
hiroaki has quit [Ping timeout: 260 seconds]
<dbotton> Is there a way to indicate in a generic function that it is generic only to a certain class and the classes descendants?
<Alfr> dbotton, and in CL generic functions only dispatch according to it's arguments' class not their types. (Ignoring eql specializers.)
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
<dbotton> Right. Let me see if I can give a quick example in code
<dbotton> (defgeneric create-child (obj html &key auto-place))
<dbotton> (defgeneric create-child (obj html &key auto-place))
<dbotton> I want to say the obj has to be only from clog-obj are a child of it
<dbotton> Os that possible?
<Alfr> dbotton, you would simply not define methods for other argument combinations. Then those calls should end up calling no-applicable-method which by default will signal an error.
<dbotton> Ok for the generic to act as "documentation" with out that not really adding anything?
<dbotton> (defmethod create-child ((obj clog-obj) html &key (auto-place t))
<dbotton> Is much more descriptive
<Alfr> That will implicitly define the generic function create-child.
<dbotton> And also says has to be clog-obj or child of it
<dbotton> Right
<dbotton> So I am trying to understand how that adds more documentation to not just use the implicit
<dbotton> defgeneric
<Alfr> dbotton, yes.
<dbotton> Sorry (I can be thick) yes to?
<Alfr> obj must a clog-obj for that method to applicable.
<Alfr> dbotton, I don't think that I understand your motivation for you initial question.
<Alfr> dbotton, it's fine to document your method only, if there's only going to be that one. But describing what the generic function is supposed to do with its arguments, may alleviate the need to document the methods.
* Alfr shrugs.
<dbotton> I was told a few times that it is better not to rely on the defgeneric as adding the generic would add to the documentation, I am trying to understand how
<dbotton> No-defun-allowed though made a nice point of "doc" strings on the method perhaps being more for documenting the internals
<dbotton> Sorry just recapping Alfr in hopes I haven't made too much a mess of the conversation
<Alfr> All's well. :)
<dbotton> I guess for now going to keep going with out the generics unless they add something and adding (export 'symbol) before methods meant to be "public"
<dbotton> Thank you all
renzhi has joined #lisp
akoana has left #lisp ["Leaving"]
EvW has quit [Ping timeout: 268 seconds]
Stanley00 has joined #lisp
skapata has quit [Remote host closed the connection]
CrazyEdd has quit [Remote host closed the connection]
also_uplime has quit [Quit: quit]
uplime has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
banjomet has quit [Remote host closed the connection]
dbotton has joined #lisp
banjomet has joined #lisp
dbotton has quit [Client Quit]
toorevitimirp has joined #lisp
phireh has quit [Remote host closed the connection]
kam1 has joined #lisp
luckless has quit [Ping timeout: 240 seconds]
luckless_ has joined #lisp
Fare has quit [Ping timeout: 260 seconds]
dbotton has joined #lisp
Bike has quit [Quit: Lost terminal]
Alfr_ has joined #lisp
<beach> Good morning everyone!
Alfr has quit [Ping timeout: 260 seconds]
thmprover has joined #lisp
Fare has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 256 seconds]
kam1 has quit [Remote host closed the connection]
leftbrain has joined #lisp
kam1 has joined #lisp
__jrjsmrtn__ has joined #lisp
CrazyEdd has joined #lisp
kam1 has quit [Remote host closed the connection]
kam1 has joined #lisp
Fare has quit [Ping timeout: 260 seconds]
<beach> dbotton: The book "Object-oriented programming. The CLOS perspective." mentions that DEFMETHOD was intended to be the main interface to the object system. But in hindsight that was a mistake.
<beach> It is a very common mistake to misspell the name of a generic function in a DEFMETHOD form, or to omit a required package prefix. Then a new generic function is silently created, and the programmer has a bug that can be difficult to track down.
<beach> For that reason, I am in favor of the implementation emitting a warning (STYLE-WARNING I guess) whenever a DEFMETHOD form is encountered that mentions the name of a generic function that has not previously been defined.
<beach> As I understand it, SBCL used to emit such a warning, but it was removed according to request from the users. I guess those users never make typos.
<dbotton> thanks
kam1 has quit [Ping timeout: 240 seconds]
<dbotton> I still have a few functional parts of my project to finish up but then have to decide on the "style" before fleshing out everything
<beach> dbotton: It seems you are (again?) trying to use Common Lisp the way you would use a language with entirely different programming model. If all you have is a single class and a single method, then write an ordinary function and an explicit check that the argument is an instance of that class.
<dbotton> Why would I choose that over a method?
lotuseater has quit [Ping timeout: 256 seconds]
narimiran has joined #lisp
<dbotton> As a method it would imply a check for the class?
<beach> Sort of. It would also allow for subclasses of that class.
<dbotton> Isn't that the case with a method and implicit generic as well?
<beach> Yes, but that doesn't seem to be what you want to communicate.
<dbotton> Not sure I see it, please explain
<aeth> generic functions are used for polymorphism or for :before/:after/:around
<dbotton> And I expect some may extend my hierarchy to use those
<beach> If you allow for subclasses, then you have a CLOS protocol, and you should document what the protocol does and what it expects. And that involves a set of generic functions together with documentation. A method specialized to the base class is an implementation detail.
<dbotton> I really like that feature
<dbotton> What is meant my clos protocol?
<beach> So by announcing the existence of a method, you are essentially (again?) writing code as if the class is the external protocol to be documented, but in CLOS, the external interface is a bunch of generic functions.
<dbotton> That I think clarifies it better for me
<dbotton> Although it seems that is more a matter of convention since there are implicit generics, ie clos's creators seemed to at least at start support a style with out the protocol written out
<beach> A CLOS protocol is a set of generic functions and possibly a set of protocol classes (not meant to be instantiated). Such a protocol is what you expose to the outside world, together with documentation about how these entities fit together.
<dbotton> I like that
<beach> Now you are confusing language semantics and software engineering.
<dbotton> Would you have a small example of that
<beach> I always create a DEFGENERIC form for every slot accessor I have.
<beach> Let me see if I can find a small example...
<dbotton> Appreciated
<dbotton> Even larger ok
<dbotton> I am used to writing a spec and body (roughly a header and body) and I like that format, ie a clear separation between implementation and design
<beach> Take a look at the documentation of Cluffer.
<dbotton> I am thinking this may bet be closer
<beach> https:/github.com/robert-strandh/Cluffer
<beach> Wait, this one is easier...
<beach> Look at appendix A.
galex-713 has quit [Ping timeout: 272 seconds]
<beach> As you can see, there is a set of protocol classes and a set of generic functions.
<dbotton> Why not places those comments as documenting of the generic?
<beach> Forget about the internal protocols for now.
<beach> Yes, I will do that some day.
<beach> I am not that much in favor of documentation strings.
Alfr_ has quit [Remote host closed the connection]
<beach> I prefer real documentation.
Alfr_ has joined #lisp
<beach> But that's a different discussion.
wxie has quit [Ping timeout: 256 seconds]
<beach> dbotton: Frequently, a protocol will have protocol classes for which it provides little or no functionality, and then it will have implementation classes that are subclasses of the protocol classes (often named standard-...). The methods of the module will be specialized to the implementation classes rather than to the protocol classes (with some exceptions).
kam1 has joined #lisp
<dbotton> I was just writing it seems like you are writing abstract classes
<beach> This technique allows client code to subclass the protocol classes to avoid the default implementation provided by the module.
<beach> The CLOS term is "protocol class".
<dbotton> Ok
galex-713 has joined #lisp
saganman has joined #lisp
<beach> Technically, you should also document the method combination and the argument precedence order of your generic functions.
<beach> And those are things you can't express with DEFMETHOD.
<saganman> Morning beach
<beach> Though, arguably, by default it is the STANDARD method combination, and the argument precedence order is the default.
<dbotton> What do you mean by method combination
<beach> clhs 7.6.6
<specbot> Method Selection and Combination: http://www.lispworks.com/reference/HyperSpec/Body/07_ff.htm
akrl has quit [Read error: Connection reset by peer]
akrl has joined #lisp
<dbotton> How would method combination change?
<beach> I don't understand the question.
<beach> The generic function is created with a particular method combination and that doesn't usually change.
<dbotton> Right, so why would I document it?
<beach> The method combination becomes part of the protocol to be documented.
<dbotton> Unless there is a change that effects a user of the system
<beach> Er, so that your clients know how to create methods?
<beach> The method combination effects the behavior of client methods.
<beach> affects
jeosol has joined #lisp
<beach> In traditional object-oriented languages, you only have one method combination, which is a subset of what the Common Lisp STANDARD method combination does.
<dbotton> I assume unless I am changing the rules why would I document it?
<beach> That's what I said.
<beach> "Though, arguably, by default it is the STANDARD method combination, and the argument precedence order is the default."
<dbotton> Sorry I perhaps got hung up on your previous statement "should also document", understood now
<dbotton> Sorry cl is a huge system with very different lingo and very different approach to most everything :) getting there
<beach> Good.
<beach> My point is that the DEFGENERIC form is the place where you can attach things like the method combination being used, the argument precedence order, the method class, the documentation, etc.
<beach> So the generic function is the thing that should be exposed to the client as part of the protocol.
thmprover has quit [Quit: For He Was Great of Heart]
<dbotton> The current project I am working on is not one that makes use of inheritance to use the system
<dbotton> So may not be perfect fit, ie protocols used by the consumer of the system
<beach> Then you definitely don't want to use DEFMETHOD, because then client code CAN create a subclass which you don't want.
<dbotton> But it may make sense for someone extending things and docs as you mention
<dbotton> Ie someone extending the system
<beach> That's what CLOS was meant to do.
<beach> to allow, I mean.
<dbotton> I hope in a few weeks to have things well enough along to ask for advice on a more cl like structure for it so I can better underst
<dbotton> Understand
<beach> OK.
<dbotton> Thank you as always, time to head to bed.
dbotton has quit [Quit: Leaving]
waleee-cl has quit [Quit: Connection closed for inactivity]
shka_ has joined #lisp
wxie has joined #lisp
andreyorst has joined #lisp
andreyorst has quit [Ping timeout: 240 seconds]
mrchampion has quit [Ping timeout: 256 seconds]
akrl has quit [Ping timeout: 246 seconds]
akrl has joined #lisp
makomo has quit [Ping timeout: 268 seconds]
leftbrain has quit [Quit: Konversation terminated!]
aindilis has quit [Remote host closed the connection]
aindilis` has joined #lisp
aartaka has joined #lisp
DateMasamune2000 has joined #lisp
andreyorst has joined #lisp
DateMasamune2000 has left #lisp ["WeeChat 2.9"]
akrl has quit [Ping timeout: 264 seconds]
akrl has joined #lisp
hugh_marera has joined #lisp
fanta1 has joined #lisp
andreyorst` has joined #lisp
andreyorst` has quit [Remote host closed the connection]
andreyorst has quit [Ping timeout: 240 seconds]
mrchampion has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
aartaka_d has joined #lisp
akrl has quit [Read error: Connection reset by peer]
akrl has joined #lisp
Cymew has joined #lisp
aartaka has quit [Ping timeout: 264 seconds]
treflip has joined #lisp
<no-defun-allowed> beach: I haven't considered documenting the argument precedence order or method combination; is it okay to assume the reader would expect them to be defaults (first argument to last, standard method combination)?
<no-defun-allowed> Though I do have a couple of generic functions with non-default values for either.
jibanes has quit [Ping timeout: 240 seconds]
<beach> I think it's OK to omit the documentation if they are the default.
<no-defun-allowed> Right, thanks.
<beach> If they are not default, I think that the client needs to know. For example a method combination might require a mandatory qualifier.
jibanes has joined #lisp
akrl has quit [Read error: Connection reset by peer]
akrl has joined #lisp
nostoi has joined #lisp
lotuseater has joined #lisp
jibanes has quit [Ping timeout: 260 seconds]
luckless_ has quit [Ping timeout: 240 seconds]
atomik_dog has joined #lisp
luckless_ has joined #lisp
jibanes has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
rjcks has joined #lisp
atomik has quit [Ping timeout: 268 seconds]
andreyorst has joined #lisp
andreyorst has quit [Ping timeout: 268 seconds]
andreyorst` has joined #lisp
Alfr_ has quit [Remote host closed the connection]
Alfr_ has joined #lisp
random-nick has joined #lisp
rgherdt has joined #lisp
pve has joined #lisp
rogersm has joined #lisp
vegansbane6 has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 256 seconds]
vegansbane6 has joined #lisp
camlriot42 has quit [Quit: Idle for 30+ days]
hendursa1 has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
shka_ has quit [Remote host closed the connection]
treflip has quit [Quit: WeeChat 2.6]
jprajzne has joined #lisp
mbomba has joined #lisp
spainisnotequal has joined #lisp
gxt has quit [Quit: WeeChat 2.9]
saganman has quit [Ping timeout: 265 seconds]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
rogersm has quit [Read error: Connection reset by peer]
rogersm has joined #lisp
duuqnd has joined #lisp
nostoi has quit [Quit: Verlassend]
kam1 has quit [Ping timeout: 240 seconds]
kam1 has joined #lisp
wxie has quit [Quit: wxie]
iskander- has joined #lisp
iskander has quit [Ping timeout: 240 seconds]
hiroaki has joined #lisp
galex-713 has quit [Ping timeout: 260 seconds]
mrcom has quit [Quit: This computer has gone to sleep]
karlosz has quit [Quit: karlosz]
shka_ has joined #lisp
galex-713 has joined #lisp
hiroaki has quit [Ping timeout: 268 seconds]
kam1 has quit [Ping timeout: 240 seconds]
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
hiroaki has joined #lisp
akrl has quit [Ping timeout: 256 seconds]
akrl has joined #lisp
kevingal has joined #lisp
mrcom has joined #lisp
saganman has joined #lisp
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 268 seconds]
Stanley00 has quit [Quit: Nice weekend]
saganman has quit [Quit: WeeChat 1.6]
kevingal has quit [Quit: Leaving]
saganman has joined #lisp
kevingal has joined #lisp
luckless_ has quit [Ping timeout: 240 seconds]
luckless_ has joined #lisp
galex-713 has joined #lisp
surabax has joined #lisp
skapata has joined #lisp
spainisnotequal has quit [Remote host closed the connection]
vegansbane6 has quit [Quit: The Lounge - https://thelounge.chat]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 265 seconds]
X-Scale` is now known as X-Scale
EvW has joined #lisp
fdddd has joined #lisp
<fdddd> (CL) Is it not permitted to have variable number of arguments to a generic function using defmethod? For instance having 2 arguments for some input combinations, and 3 arguments for some other input combinations.
<phoe> fdddd: yes, but you cannot specialize on optional arguments
<no-defun-allowed> You can use &optional, &rest and &key as usual for functions, but you cannot specialise on those arguments.
<phoe> (defgeneric foo (bar baz &optional quux))
<phoe> then specialize on BAR and BAZ
<phoe> if you need a different behavior, then it's common to make QUUX optional but pass NIL in some cases to it - see e.g. MOP:ENSURE-GENERIC-FUNCTION for an example.
<phoe> mop ensure-generic-function
<phoe> uh wait not that
<phoe> clhs ensure-class
<specbot> Couldn't find anything for ensure-class.
<phoe> clhs ensure-class-using-class
<specbot> Couldn't find anything for ensure-class-using-class.
<phoe> there - the CLASS argument is either a class metaobject or NIL
<fdddd> Oh I see. I was specializing on the third parameter in one case, but I might just rename the method that takes only 2 arguments since it's a special case and for internal use only.
<phoe> that would be even better
jprajzne has quit [Ping timeout: 260 seconds]
<phoe> especially if your GF is a part of your external API
Necktwi has quit [Ping timeout: 265 seconds]
joaot has joined #lisp
jprajzne has joined #lisp
Necktwi has joined #lisp
<fdddd> Another question: Is it unwise/not possible to reuse accessor names for slots of different classes in the same package? Was reading yesterday about packages and from what I could understand the symbol used by each method (i.e. accessors?) had to be "exported" to be used elsewhere (or rather imported by users). Could this conflict with duplicate slot accessor names?
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
<joaot> fdddd
<joaot> fdddd: Possible and not particularly unwise.
kam1 has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 246 seconds]
vegansbane6 has joined #lisp
jibanes has joined #lisp
frost-lab has quit [Quit: Connection closed]
dhil has joined #lisp
mbomba has quit [Quit: WeeChat 3.0]
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
<jackdaniel> there is something about load-time-forms implementation what makes my brain go dizzy each time I work on it
<jackdaniel> s/implementation/specification/ s/work on it/work on the implementation/
dmc00 has quit [Ping timeout: 258 seconds]
dmc00 has joined #lisp
galex-713 has joined #lisp
heisig has joined #lisp
kam1 has quit [Ping timeout: 272 seconds]
kam1 has joined #lisp
<shka_> fdddd: the trick is to think accessors as of any other generic function, that just happens to use cache in the form of the slot
hiroaki has quit [Ping timeout: 256 seconds]
<fdddd> shka_: What do you mean by "use cache in the form of the slot"?
<shka_> i mean that a proper object oriented code does not use data structures with accessors but instead objects embedded within a communication protocol
<shka_> and if you are doing the former, some of "messages" in the protocol are queries
<shka_> and those queries just happens to be implemented as reader
galex-713 has quit [Ping timeout: 272 seconds]
<shka_> and if so, why it would matter? if you are asking for foo, it does not matter on what you are calling it
<shka_> as long as you are getting consistent results
<shka_> fdddd: makes sense?
orivej has joined #lisp
galex-713 has joined #lisp
cosimone has joined #lisp
<fdddd> I think I see what you mean. If you look at e.g. (foo ...) as the "query" and then give any applicable class you expect to get the foo field as a result either way, e.g. (foo class-x) or (foo class-y). Something like this?
galex-713 has quit [Read error: Connection reset by peer]
galex-713 has joined #lisp
hiroaki has joined #lisp
makomo has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
daphnis has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
dddddd has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 260 seconds]
cosimone has quit [Remote host closed the connection]
dddddd has joined #lisp
kam1 has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
dbotton has joined #lisp
hiroaki has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
gko_ has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
dbotton has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
hiroaki has joined #lisp
kam1 has joined #lisp
amb007 has joined #lisp
EvW has joined #lisp
kam1 has quit [Quit: Quit]
kam1 has joined #lisp
Bike has joined #lisp
zacts has joined #lisp
<beach> fdddd: Yes, that happens somewhat often, like (NAME <object>) for instance.
zacts has quit [Client Quit]
<beach> fdddd: In older CLOS code, the convention seems to have been to prefix the accessor by some class name, presumably the protocol class, like (SHEET-PARENT <sheet>), but I think that is silly, and it is better to use the package system for that kind of stuff.
<fdddd> beach: So you cannot have 2 classes in the same package with a slot/accessor called e.g. "name"?
<beach> Yes, you can, and it happens fairly often.
<beach> You just get two methods on the one generic function.
<beach> And it's not a problem.
<fdddd> Ahh I see. Makes sense. I guess I can look at this as working like (defmethod name ((name class-x)) ...) and (defmethod name ((name class-y)) ...) would?
<beach> Yes, that's what happens really.
<jackdaniel> I think that having different function names for separate protocols defined in the same package is not silly
dbotton has quit [Quit: This computer has gone to sleep]
<beach> jackdaniel: Right. What is silly is to have more than one protocol defined in a single package.
<beach> But it is possible to have two independent classes be member of the same protocol, and they both have a NAME accessor.
<beach> I don't see a problem with that.
<_death> fdddd: you should think about the generic function (say NAME).. you assign it certain semantics, and if a defmethod defined by defclass reader/writer is consistent with these semantics then it's ok
<joaot> The protocol /is/ NAME, whoever adds methods to that GF is a member of that protocol
<jackdaniel> I don't see the problem with two classes participating in the ame protocol, but imo having a single package per each protocol is good
<jackdaniel> a package per protocol*
<beach> joaot: Not quite. A protocol contains a bunch of generic functions and a bunch of classes.
kam1 has quit [Quit: Quit]
kam1 has joined #lisp
<beach> jackdaniel: I agree (if I understand you right).
<joaot> CLHS doens't define "protocol" afaik. You can define it the way you like. For me a GF is a protocol, an interface if you prefer. Its docstrings says what goes in and what comes out.
<beach> I am sorry to hear that.
<_death> joaot: check out the clim spec
<_death> or AMOP..
<jackdaniel> what I'm saying is that having a single implementation package which hosts multiple protocols makes more sense than having multiple packages for each protocol, even if that implies separate names like sheet-parent and output-record-parent
wsinatra has joined #lisp
<joaot> I just know CL, but sure, maybe I shouldn't use the word "protoco"l if its loaded with that specific meaning
<beach> _death: Also Keene, page 30.
<beach> joaot: It is already used in a specific way by all the sources cited.
<joaot> Well it's not in the bible's glossary: http://www.lispworks.com/documentation/lw50/CLHS/Body/26_glo_p.htm :-D
<joaot> but sure s/protocol/joaosprotocol/g
<beach> "The generic functions taken together can be called a protocol. A protocol encompasses the complete behavior of the objects in the program."
hendursa1 has quit [Quit: hendursa1]
<joaot> I was just trying to convey how I I think about GFs
hendursaga has joined #lisp
<_death> beach: nice.. it only speaks of a set of GFs, whereas the clim spec also has a "protocol class" if I recall correctly.. but close enough
<beach> Yes, protocol classes can be included, and initargs.
<_death> joaot: it's true that a protocol may consist of a single GF and nothing more
<joaot> _death: Though in practice it seldom does. Yes, a GF is a only a piece of a protocol
hendursaga has quit [Remote host closed the connection]
<joaot> What I find hard to convey no people from other languages is that one can use the same GF across different classes of objects. And that it's fine to do that.
kam1 has quit [Quit: Quit]
kam1 has joined #lisp
<beach> joaot: You can do what I have practiced for a long time. Avoid trying to make those people understand by not talking about Common Lisp to them.
<phoe> beach: kinda not viable in the long run
<joaot> Heh, the high-horse approach
<beach> phoe: I just let people like you do it in my place. :)
<_death> or talk Common Lisp to them and leave it to them to understand ;)
<phoe> beach: hah
<phoe> touché
<beach> :)
hendursaga has joined #lisp
dbotton has joined #lisp
Fare has joined #lisp
<jmercouris> any pure Lisp sqlite libraries not relying on a shared library?
<phoe> jmercouris: you mean not relying on libsqlite?
<phoe> you can't have that
<jmercouris> I see, why not?
<phoe> mostly because sqlite only has one real implementation, AFAIK
<jmercouris> because API changes?
<jmercouris> OK, fair enough
<phoe> and that implementation is written in C.
<jmercouris> well yeah, but sqlite files should be readable by anything really
<phoe> yes, but that requires reimplementing sqlite.
<jmercouris> yes
<phoe> or at least a large chunk of it
<jmercouris> that's basically what I was asking
<jmercouris> I guess it is not public API then
<phoe> and I'm not of aware of any project that reimplements that part, even outside Lisp
<jmercouris> one more question
<jmercouris> any open source documentation libraries?
<phoe> the format seems well specified at https://www.sqlite.org/fileformat.html
<jmercouris> something like Dash, but open source?
<phoe> MGL-PAX was recently on reddit; something like that?
<beach> Wow, the stuff #lisp participants are expected to know.
<jmercouris> hm, that is quite well specified
<jmercouris> :-)
<jmercouris> not like MGL-PAX, I'm looking for datasets that I can parse in Lisp
<jmercouris> I looked at Dash, but their license seems to imply I cannot use the database
<jmercouris> "You are not allowed to distribute or make use of any of the files within this folder ("Resources") without written permission from Kapeli or whilst using the Dash app developed by Kapeli. This does not apply to the files located within the "Documents" folder."
<jmercouris> the part that gets me is the 'make use of'
<jmercouris> otherwise I could produce some derivative from the data, not sure if that is even an enforcable clause
<phoe> what's your use case though?
<jmercouris> Imagine a book that said 'you are not allowed to make usage of the information in this book'
<jmercouris> I am trying to make a documentation reader/helper for Nyxt
<phoe> oh, I see
<phoe> something like ccldoc perhaps.
<Bike> that clause sounds enforceable to me, and anyway you probably shouldn't "agree" to a contract/license based on the idea that it's not real
<phoe> it could use some polish and modernization mayhaps
<jmercouris> yeah that would work, I'm not super worried about the format of the data
<Bike> or so i've heard lawyers say
<jmercouris> Bike: can you rephrase, I don't understand what you've said, and I will not construe it as legal advice :-D
<Bike> that is kind of an annoying sounding license though
<jmercouris> phoe: the value is in the datasets, I can make whatever parser is necessary
<jmercouris> I've thought about reindexing the dash datasets using our text analysis technology in Nyxt
<jmercouris> however, will it ever be as good as hand curated datasets?
<phoe> jmercouris: what do you mean, "datasets"?\
<jmercouris> it may be more extensive, but resulting in more false positives
<jmercouris> so a dash docset contains a sqlite database file, three columns: "name, type, path"
<jmercouris> example CL print function, "print, function, clhs path to print function"
<jmercouris> it also contains a 'documents' directory that contains all of the assets pointed to by the database
<phoe> okay, the API seems similar to that of #'CL:DOCUMENTATION
<jmercouris> yeah, it isn't particularly novel
<jmercouris> I don't care so much about the format though
<jmercouris> I care mostly about the availability of data
<jmercouris> s/data/sanitized processed data
<dbotton> Phoe I am using mgl-pax, I am enjoying the doc -> markdown etc but then I like to document as I write code
<phoe> what sorta datasets are you looking for? that no longer sounds strictly Lisp-related
<jmercouris> well, it isn't strictly Lisp specific... I'm looking for any documentation format/data that is widely adopted/used
<jmercouris> can't seem to find anything besides dash
<dbotton> Info like in emacs?
<jmercouris> why is it related to lisp? should I find this dataset, it will gain a Lisp interface :-D
<jmercouris> I guess you could say that
<jmercouris> hm, closest parallel: https://github.com/zealdocs/zeal
daphnis has quit [Ping timeout: 240 seconds]
gxt has joined #lisp
EvW has quit [Ping timeout: 268 seconds]
mfiano has quit [Ping timeout: 256 seconds]
mfiano has joined #lisp
ex_nihilo has quit [Quit: Leaving]
<dbotton> Beach I am switching my base to use the defgenerics to document etc, if I have a key with a default value that is not expressed, would you just mention that in your :documentation on the defgeneric?
kaftejiman has joined #lisp
<dbotton> (defgeneric create-child (clog-obj html &key auto-place)
<dbotton> (:documentation "Create a new CLOG-OBJ from HTML element as child of OBJ and if :AUTO-PLACE
<dbotton> place-inside-bottom-of OBJ (defaults to t)"))
<_death> yes.. and note that defgeneric documentation should be both for callers and for specializers
<dbotton> Ok
<_death> it may make sense to split the audience, so that there are two functions
<dbotton> So no issue to redefine a generic?
jibanes has quit [Ping timeout: 268 seconds]
<beach> Yes, I tend to agree with _death.
<_death> what I mean is two have a create-child function for callers (that takes the keyword arguments), and a create-child-gf (think of a better name) that takes 3 required arguments, for example
<beach> Generic functions can be redefined.
<_death> *to have
<beach> dbotton: What _death is saying is a very common practice.
jibanes has joined #lisp
waleee-cl has joined #lisp
<beach> dbotton: For example WRITE-CHAR may call STREAM-WRITE-CHAR with two required arguments.
<beach> dbotton: It is then also common to have the end-user function be an ordinary function (like WRITE-CHAR).
<_death> right, and sometimes that kind of separation leads to a better protocol, which Gray streams miss because they mostly parrot the caller interface
lotuseat` has joined #lisp
<dbotton> So you end up with two protocols in the end? are you keeping both in same file (I assume same package)?
<dbotton> One to use one to extend
lotuseater has quit [Ping timeout: 264 seconds]
<beach> dbotton: Whether you consider them part of the same protocol or two separate protocols is not terribly important. They can be in the same package or in different packages.
rpg_away has quit [Quit: Textual IRC Client: www.textualapp.com]
lotuseat` is now known as lotuseater
toorevitimirp has quit [Remote host closed the connection]
<beach> dbotton: For example, in SICL, the function FLOOR (with one required and one optional parmeter) and the generic version GENERIC-FLOOR (with two required parameters) are both defined in the package SICL-ARITHMETIC. However, since that package :USEs the COMMON-LISP package, FLOOR is the symbol in the COMMON-LISP package and GENERIC-FLOOR is a symbol in the SICL-ARITHMETIC package.
<beach> So FLOOR is defined like this: (defun floor (number &optional (divisor 1)) (generic-floor number divisor)) with no additional package prefixes and such.
<dbotton> ok
<dbotton> I'll think it through
<jmercouris> how to download a file through dexador get? should I write the body to a file stream?
<jmercouris> I won't be able to extract a tar file in Lisp either... will I?
<phoe> jmercouris: there are deflate decoders in lisp
<jmercouris> chipz?
<_death> and a library called "archive"
<jmercouris> not the easiest library to search for
<_death> (ql:system-apropos "archive") pretty easy
<jmercouris> _death: 11
<shinohai> jmercouris: with chipz https://dpaste.com/9EYWE7KR9
<jmercouris> shinohai: thank you
<shinohai> np forgot where I found that tidbit, used it for a script a couple years ago, but worked a++
<jmercouris> not the most straightforward looking API
<jmercouris> would have taken me a while
<shinohai> I tried using an ugly uiop:run-program hack, but had mixed results. xD
<jmercouris> I was very close to doing that myself as well
rpg has joined #lisp
<jmercouris> what is wrong with: https://dpaste.com/DSA6XBDRP ?
<jmercouris> trying to write a octect vector to a file...
<_death> you need :element-type '(unsigned-byte 8)
<_death> also, I think you can get dex:get to get you a stream
<jmercouris> I believe you are right about the stream
sjl has joined #lisp
<_death> (why can't these things take a stream?)
kam1 has quit [Ping timeout: 240 seconds]
<jmercouris> thanks _death
<jmercouris> I had forgotten that
entre-parenteses has joined #lisp
wsinatra has quit [Ping timeout: 264 seconds]
jonatack has quit [Ping timeout: 268 seconds]
aartaka has quit [Ping timeout: 272 seconds]
wsinatra has joined #lisp
gaqwas has quit [Remote host closed the connection]
gko_ has quit [Ping timeout: 240 seconds]
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<beach> phoe: Can you explain in a sentence or two why restart-case checks whether the restartable-form is a signaling form?
<phoe> beach: condition-restart association.
<beach> Is that a requirement?
<phoe> clhs restart-case
<phoe> "If the restartable-form is a list whose car is any of the symbols signal, error, cerror, or warn (or is a macro form which macroexpands into such a list), then with-condition-restarts is used implicitly to associate the indicated restarts with the condition to be signaled."
<shka_> fdddd: for what is worth i subscribe to _death point of view
<phoe> Yes, this is mandatory.
<beach> Got it. Thanks!
<beach> I should have read more carefully before asking. Sorry about that.
<phoe> no problem, I have the condition system in my caches so it's much easier for me to answer
<beach> True dat.
<phoe> especially with regard to really hipster features of the condition system that most people don't even notice most of the time, such as condition-restart association
<phoe> or handler clustering.
<beach> Sure.
fdddd has quit [Remote host closed the connection]
daphnis has joined #lisp
aindilis` has quit [Remote host closed the connection]
aindilis has joined #lisp
<kevingal> Anyone know how to increase dynamic heap size when you're using Portacle? I've tried adding `(setq inferior-lisp-program "sbcl --dynamic-space-size 10240")` to user.cl, but no luck. And grepping the Portacle directories for "inferior-lisp-program" doesn't bring up anything obvious.
<_death> try (setq slime-default-lisp 'sbcl slime-lisp-implementations '((sbcl ("sbcl" "--dynamic-space-size" "10GB"))))
<_death>
<_death> I don't use portacle, but that's similar to what I have in my .emacs
<kevingal> I see, I found some config where Portacle sets slime-lisp-implementations.
<kevingal> Somehow missed this answer: https://stackoverflow.com/a/10872585/1840198
<kevingal> Well, cheers!
jibanes has quit [Ping timeout: 258 seconds]
<jmercouris> cheers :-)
<_death> kevingal: btw your name sounded familiar.. turns out I liked your blog posts ;)
<jmercouris> A compliment from _death ! record the date! :-D
<jmercouris> and beach used slang, what is going on in 2020
jibanes has joined #lisp
<kevingal> Someone reads those? :D
<shka_> apparently so
<jmercouris> You'd be surprised how many people silently consume resources
<jmercouris> we are the minority actually speaking
daphnis has quit [Ping timeout: 260 seconds]
<kevingal> I'm a mostly silent consumer myself, for shame.
<jackdaniel> given how much low quality material is distributed over the internet it is hard to find good reads anyway
kam1 has joined #lisp
<beach> jmercouris: What slang?
<jmercouris> beach: "True dat."
<beach> Ah, heh.
<jmercouris> real talk true story
<loke[m]> Argh... Is there a way to get a git log of a repository without doing a clone?
<shka_> uhm
<shka_> that happend
<jmercouris> loke[m]: no
<shka_> yes it did
aartaka has joined #lisp
<jmercouris> loke[m]: creating the log requires a copy of the repository
<loke[m]> jmercouris: All I want is the ID of the most recent commit on master actually.
<jmercouris> loke[m]: the remote machine could make the log for you
<loke[m]> I'm building a script that generated a Climaxima build and it needs those build ID's.
<jmercouris> loke[m]: you will still need to query the remote machine
<loke[m]> Sure.
<loke[m]> But I don't want to have to do a clone.
<jmercouris> yes
<jmercouris> so you are better of implementing the script that returns the latest commit and running it on the other machine
<loke[m]> For Maxima in particular, a full clone takes a ridiculous amount of time, when all I need is the build id.
<jmercouris> if you don't have control of the other machine, it is not possible
<loke[m]> The other machine is Sourceforge
<jmercouris> perhaps it is in their API
<loke[m]> I think github has an API for it, but SF?
<jmercouris> I'm not familiar I'm afraid
<scymtym> loke[m]: some invocation of git ls-remote should do that
<loke[m]> aha
<loke[m]> scymtym: that's it! Thanks.
<jmercouris> thats incredibly useful
<loke[m]> `git ls-remote url refs/heads/master`
Josh_2 has joined #lisp
duuqnd has quit [Remote host closed the connection]
duuqnd has joined #lisp
andreyorst` has quit [Quit: andreyorst`]
andreyorst has joined #lisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
rpg has joined #lisp
matryoshka has quit [Ping timeout: 260 seconds]
matryoshka has joined #lisp
dmiles has quit [Ping timeout: 256 seconds]
cosimone has joined #lisp
vhost- has quit [Ping timeout: 256 seconds]
vhost- has joined #lisp
dbotton has quit [Read error: Connection reset by peer]
dbotton has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
dbotton has quit [Read error: Connection reset by peer]
dbotton has joined #lisp
kam1 has quit [Remote host closed the connection]
kam1 has joined #lisp
EvW has joined #lisp
Lord_of_Life_ has joined #lisp
dbotton has quit [Quit: Leaving]
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
kam1 has quit [Ping timeout: 272 seconds]
yitzi has joined #lisp
joaot has quit [Ping timeout: 245 seconds]
kam1 has joined #lisp
iskander has joined #lisp
iskander- has quit [Ping timeout: 260 seconds]
<jdz> loke[m]: It's possible to make a shallow clone (--depth 1).
wsinatra has quit [Ping timeout: 240 seconds]
kam1 has quit [Ping timeout: 256 seconds]
wsinatra has joined #lisp
matryoshka has quit [Ping timeout: 265 seconds]
zulu-inuoe has quit [Quit: Leaving]
Steeve has joined #lisp
matryoshka has joined #lisp
orivej has joined #lisp
pankajsg has quit [Ping timeout: 256 seconds]
Nilby has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
aartaka_d has joined #lisp
aartaka_d has quit [Ping timeout: 256 seconds]
cosimone_ has joined #lisp
EvW1 has joined #lisp
<pyc> Here is my code and output: https://pastebin.com/We9Ka4aq Why does hunchentoot not start and listen on port 4242 when I run this code?
EvW has quit [Ping timeout: 260 seconds]
cosimone has quit [Ping timeout: 268 seconds]
cosimone_ is now known as cosimone
akoana has joined #lisp
<rpg> pyc: What do you see when you hit port 4242? How do you know that hunchentoot didn't start? What happens if you do (trace hunchentoot:start) ?
EvW1 has quit [Ping timeout: 258 seconds]
<pyc> rpg: oh! it did start!
<pyc> Is it common to have (ql:quickload ...) expressions in the main source code?
<lotuseater> hm i think yes for standalone files or "scripts"
daphnis has joined #lisp
<pyc> lotuseater: in which case (ql:quickload ...) should not be part of the main source code?
<lotuseater> you may have same in the rc file for your implementation eg .sbclrc
<lotuseater> pyc: for defined packages and asdf systems
Steeve has quit [Quit: end]
Inline has joined #lisp
quack14 has joined #lisp
rogersm has quit [Ping timeout: 258 seconds]
rogersm has joined #lisp
<rpg> pyc: If you build a more substantial system for your web server, it would be normal to put the dependency on hunchentoot into your own (ASDF) system definition. But for this kind of early experimentation, what you are doing is fine (IMO).
EvW has joined #lisp
wsinatra has quit [Ping timeout: 272 seconds]
wsinatra has joined #lisp
rogersm has quit [Quit: Leaving...]
dbotton has joined #lisp
daphnis has quit [Ping timeout: 260 seconds]
dbotton has quit [Quit: Leaving]
puchacz has joined #lisp
iskander has quit [Ping timeout: 256 seconds]
<puchacz> hi, does anybody know how Eitaro Fukamachi was launching sbcl from node.js to build an electron application?
<puchacz> maybe if I knew node.js it would be obvious how to do it :)
imode has joined #lisp
<pyc> How is that both (ql:quickload "hunchentoot") and (ql:quickload :hunchentoot) work fine? Is one of them preferred over the other?
<puchacz> pyc - this function takes a "string designator" as the argument type presumably
<phoe> ^
cognemo has quit [Quit: cognemo]
<puchacz> so you have a few types defined in CLHS that coercible to string and how the coercion / conversion is done
<puchacz> keywords, symbols, strings themselves
<puchacz> not sure what else
cognemo has joined #lisp
<phoe> AFAIR characters denote single-element strings
<phoe> yes, characters + symbols + strings
<entre-parenteses> puchacz: I can't say for sure, but he may have been using ceramic?
<entre-parenteses> puchacz: https://ceramic.github.io/
<puchacz> entre-parenteses - I don't think so, ceremic is the other way round - Lisp starts chrome process, and there is no node.js I think
jonatack has joined #lisp
<puchacz> I would evaluate both ways with or without node
<entre-parenteses> Oh, yeah. I guess I misread your question. Node.js has this: https://nodejs.org/docs/latest-v13.x/api/child_process.html that might do it?
<puchacz> if you know node.js, does it sound like the right way :) ? I intend to learn just enough node.js to try his way :)
yitzi has quit [Quit: yitzi]
yitzi has joined #lisp
<susam> Time and again I mistype `M-x slime` as `M-x smile`. Something wrong with the wiring in my brain I guess.
<susam> By the way, `:smile` happens to be a valid command in Vim.
<entre-parenteses> I'd assume this is at least acceptable given it's part of the API but I couldn't say, for sure, if that's the "right way". I only know enough about node to be able to do some side projects - I've never used it in a professional capacity that would require me to know the right way of doing things.
<entre-parenteses> Sorry I don't have a better answer for you.
amb007 has quit [Read error: Connection reset by peer]
<puchacz> thanks
amb007 has joined #lisp
jonatack has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
jonatack has joined #lisp
heisig has quit [Ping timeout: 256 seconds]
Blukunfando has quit [Ping timeout: 264 seconds]
frgo_ has quit []
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
liberliver has quit [Ping timeout: 268 seconds]
amb007 has quit [Read error: Connection reset by peer]
yitzi has quit [Quit: yitzi]
yitzi has joined #lisp
hal99999 has joined #lisp
Misha_B has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
jonatack has quit [Ping timeout: 272 seconds]
jonatack has joined #lisp
amb007 has joined #lisp
hal100000 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
hal99999 has quit [Ping timeout: 240 seconds]
mrchampion has quit [Remote host closed the connection]
andreyorst has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
mrchampion has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
cosimone has quit [Quit: cosimone]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
dilated_dinosaur has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
amb007 has joined #lisp
daphnis has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
random-nick has quit [Quit: quit]
hal99999 has joined #lisp
quack14 has quit [Remote host closed the connection]
Lord_of_Life has quit [Ping timeout: 246 seconds]
hal100000 has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
dilated_dinosaur has joined #lisp
yitzi has quit [Remote host closed the connection]
random-nick has joined #lisp
random-nick has quit [Ping timeout: 272 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
aartaka has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
daphnis has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
madand has quit [Quit: ZNC 1.8.2 - https://znc.in]
madand has joined #lisp
srandon111 has joined #lisp
narimiran has quit [Ping timeout: 256 seconds]
hnOsmium0001 has joined #lisp
cognemo has quit [Quit: cognemo]
cognemo has joined #lisp
daphnis has joined #lisp
joaot has joined #lisp
dbotton has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
frgo has joined #lisp
EvW has joined #lisp
joaot has quit [Ping timeout: 245 seconds]
greaser|q has quit [Changing host]
greaser|q has joined #lisp
greaser|q is now known as GreaseMonkey
daphnis has quit [Ping timeout: 240 seconds]
random-nick has joined #lisp
Jesin has quit [Quit: Leaving]
<dbotton> Is there a way to create a setf function from a method?
<dbotton> (Or perhaps should say from a defgeneric)?
<_death> sure
Jesin has joined #lisp
<_death> setf functions are just functions with a name like (setf foo) that receive the new value as their first argument and should also return it when they're done
<dbotton> So use defsetf?
<phoe> or defun, or defmethod
<phoe> (defun (setf foo) (newval ...) ...)
<phoe> (defmethod (setf foo) (newval ...) ...)
<_death> defsetf is not how you define a setf function
<dbotton> So if doing a defmethod would do a generic also?
<phoe> what do you mean, would do a generic also?
<dbotton> (defgeneric (setf foo) (n))
<phoe> (defmethod (setf foo) ...) implies (defgeneric (setf foo) ...)
<phoe> yes
rumbler31 has joined #lisp
cosimone has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
rjcks has quit [Quit: leaving]
<dbotton> Is there a way to make this in to a setf (defmethod set-property ((obj clog-obj) property-name value)
hal99999 has quit [Ping timeout: 240 seconds]
<phoe> what does set-property do?
<mfiano> (defmethod (setf property) (value (obj clog-obj) property-name) ..)
<dbotton> (setf (property obj "color") red)
<phoe> yes, then what mfiano said
<dbotton> thanks
<rumbler31> anyone familiar with using cxml or otherwise processing xml, I could use some ideas. I have a bunch of template files that have been filled in with data. now the template files themselves have received updates (I'll call them my input files), and I need to go through and update each input file by checking for missing children or updated metadata. I'm going to be doing a lot of (find the parent who's child
<rumbler31> text contains "this key" and iterate through all of the children in the new template to see if there are any new children and add them to the parent, etc)
<rumbler31> right now I just have a tree of objects from cxml. In xml processing systems there is usually support for XPath style "selectors" or outright XQueries, and i'm wondering where the best xml support in lisp lives
<dbotton> So my generic looks like this? (defgeneric (setf property) (value obj property-name)
hal99999 has joined #lisp
<Nilby> rumbler31: I think lquery is good, but I also find traditional Lisp tools good enough to operate on a parsed XML tree, in my case loaded with plump.
<Nilby> rumbler31: There's also clip for templating, in Shinmera's -ecosystem, but I haven't tried it yet.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<dbotton> In this case exporting just the property symbol would cover both the setf and the regular method correct?
<phoe> yes
<rpg> dbotton: Yes, because you don't export functions, only symbols. So anything that is attached to the symbol is exported.
<fiddlerwoaroof> rumbler31: there are also xpath-related stuff in CXML
<dbotton> Thanks
<rumbler31> ahh nice
daphnis has joined #lisp
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 240 seconds]
cosimone_ is now known as cosimone
<dbotton> Thanks, now things look lispier :)
dbotton has quit [Quit: This computer has gone to sleep]
banjomet has quit [Quit: Leaving]
Fare has quit [Ping timeout: 264 seconds]
bendersteed has joined #lisp
vsync has quit [Ping timeout: 260 seconds]
daphnis has quit [Ping timeout: 268 seconds]
<moon-child> (sadly, they don't have the transparent persistence of a proper lisp os, but the rest of the major pieces seem to be there)
vsync has joined #lisp
Fare has joined #lisp
kam1 has joined #lisp
choegusung has joined #lisp
choegusung has quit [Client Quit]
Blukunfando has joined #lisp
cosimone has quit [Quit: cosimone]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #lisp
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rumbler31 has quit [Ping timeout: 240 seconds]
cosimone has joined #lisp
daphnis has joined #lisp
actuallybatman has joined #lisp
hal99999 has quit [Quit: hal99999]
Josh_2 has joined #lisp
sjl has quit [Ping timeout: 265 seconds]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
rumbler31 has joined #lisp
kevingal_ has joined #lisp
Josh_2 has quit [Remote host closed the connection]
kevingal has quit [Ping timeout: 272 seconds]
jibanes has quit [Ping timeout: 272 seconds]
rpg has joined #lisp
jibanes has joined #lisp
dhil has quit [Ping timeout: 272 seconds]
thmprover has joined #lisp
Dizidentu has joined #lisp
<Dizidentu> whats the neatest thing u can code in lisp
<duuqnd> yes
<Dizidentu> agreed
<curiouscain> You can code whatever you like
daphnis has quit [Ping timeout: 272 seconds]
tempest_nox has joined #lisp
<aeth> Dizidentu: something like this? (note: not all of them are Common Lisp). https://itch.io/jam/autumn-lisp-game-jam-2020/results
<Dizidentu> glad it can
<Dizidentu> but I understand that the strong points are in the toolset
<no-defun-allowed> "not all" is an understatement.
<Dizidentu> but yeah, I would code a game with lisp if I wasnt a cpp monkey xd
<lotuseater> aeth: spilljakers looks like DOOM prototyped
<no-defun-allowed> Maybe even none of them are Common Lisp?
<duuqnd> The Lisp game jams are always so disappointing
<duuqnd> I mean, the intention is good, but it's always just fennel and shit
<moon-child> Dizidentu: i made a game engine with d, using lisp as a scripting language
<no-defun-allowed> I'm not going to comment (okay, well, what duuqnd said) because I don't make games other than Doom maps.
Jeanne-Kamikaze has joined #lisp
<no-defun-allowed> But from what I've heard about #lispgames, making game engines is the easier part of making games in Lisp.
<duuqnd> I think the problem is that most people who want to make games in Lisp have a hard time finishing games
wsinatra has quit [Quit: WeeChat 3.0]
<lotuseater> moon-child: sounds also great :)
<aeth> lotuseater: looks more like Wolf 3D than Doom to me. Thick, blocky walls, although they have varying heights, unlike Wolf 3D. No varying floor heights like in Doom, though.
<moon-child> duuqnd: can relate...
<lotuseater> aeth: hm yes you're right, i intended to mean it non specific
<no-defun-allowed> The "neatest" thing I did this week was probably to port my async code to use "monads" and do-notation.
<duuqnd> I looked through the games from the 2020 Lisp game jam. One game in Racket, one used Guile, and the rest used garbage lisps. Maybe I should've made an entry after all...
kam1 has quit [Ping timeout: 256 seconds]
<lotuseater> no-defun-allowed: really? o_O what do you use or how did you accomplish that? :)
<no-defun-allowed> Though I call them "actions" to scare off Haskell programmers, and to not scare off non-Haskell programmers.
<lotuseater> i once saw on rosettacode under "Metaprogramming" some approaches to that stuff
<no-defun-allowed> I don't recall the rules for translating do into >>=, but they're quite simple, and a quick REDUCE makes the form I want.
<aeth> that FPS looking game is in the browser so I can play it, and it's definitely intended to be more retro than even Wolf3D
cosimone has quit [Quit: cosimone]
kaftejiman has quit [Remote host closed the connection]
<aeth> so weird using retro controls even though I've played a lot of retro FPSes over the years... the arrow keys where you don't strafe with left/right, you rotate
<no-defun-allowed> Hovertank 3d?
<lotuseater> yes i now what you mean, have to remember that also (or WHY that works)
<duuqnd> That game honestly looks so basic that even hovertank 3d looks impressive by comparising
<duuqnd> comparison*
<no-defun-allowed> do a <- b; c is a >>= (\b -> c) ad do a; b is a >> b
<lotuseater> yes you're right
<no-defun-allowed> do let a = b; c is also let a = b in c, and you basically wrap around the last form, then the second last, third, etc to produce the desugared form.
<lotuseater> people always got confused when i said to them "no here we don't start with 'Hello World'"
<aeth> duuqnd: The problem with game jams is that if you can actually make a game with your Lisp game engine, you might as well just make and sell it
<no-defun-allowed> I like it because I can manipulate actions as values before running them, so I could do (then ... (if something this-action that-action)), and it could be easier to compose, like (then* (f) (g)) over (f :callback (g)) or something.