<contrapunctus>
Shinmera: is there some way to programmatically obtain the list of definition types supported by `definitions`?
grawlinson has quit [Quit: SIGTERM]
lisp123 has joined #commonlisp
grawlinson has joined #commonlisp
mrcom has quit [Remote host closed the connection]
mrcom has joined #commonlisp
lisp123 has quit [Ping timeout: 260 seconds]
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
Bike has quit [Quit: Connection closed]
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
minion has joined #commonlisp
specbot has joined #commonlisp
jack_rabbit has joined #commonlisp
knusbaum has quit [Ping timeout: 240 seconds]
bilegeek has joined #commonlisp
jmdaemon has joined #commonlisp
* contrapunctus
tries something using `(definitions:find-definitions (find-package :definitions))`
jmdaemon has quit [Ping timeout: 248 seconds]
<contrapunctus>
...but even if I filter that with `(typep <object> 'definitions:global-definition)`, I'm not sure the resulting list is what I'm looking for 🤔️
jmdaemon has joined #commonlisp
jmdaemon has quit [Remote host closed the connection]
pranavats has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
anticomputer has joined #commonlisp
Josh_2 has joined #commonlisp
lisp123 has quit [Ping timeout: 246 seconds]
MajorBiscuit has joined #commonlisp
<Josh_2>
GM :sunglasses:
Josh_2 has quit [Remote host closed the connection]
axel-bee has quit [Remote host closed the connection]
axel-bee has joined #commonlisp
axel-bee has quit [Remote host closed the connection]
<Shinmera>
err, looks like the (mapc was lost in the line truncation there, but I'm sure you can figure it out.
azimut has quit [Ping timeout: 240 seconds]
monaaraj has joined #commonlisp
azimut has joined #commonlisp
<Josh_2>
Finally I have rigged together a basic login system with Ningle :facepalm:
ttree has quit [Ping timeout: 276 seconds]
mon_aaraj has quit [Ping timeout: 246 seconds]
rogersm has joined #commonlisp
attila_lendvai has joined #commonlisp
<Shinmera>
Not to be snippy, but Radiance includes modules for session, user, and authentication that you can just pull in when needed.
<Shinmera>
And because they're written against specified interfaces, they can also be switched out (such as for one using ldap) without having to change the code of your actual app/site.
pve has joined #commonlisp
Th30n has joined #commonlisp
Brucio-61 has quit [Ping timeout: 256 seconds]
monaaraj has quit [Quit: WeeChat 3.5]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Read error: Connection reset by peer]
mon_aaraj has joined #commonlisp
mon_aaraj has quit [Read error: Connection reset by peer]
<contrapunctus>
(my first-ever use of `labels` 😄️)
<Shinmera>
yep.
notzmv has quit [Ping timeout: 260 seconds]
livoreno has quit [Ping timeout: 260 seconds]
MajorBiscuit has joined #commonlisp
Brucio-61 has joined #commonlisp
Posterdati has quit [Read error: Connection reset by peer]
mon_aaraj has quit [Ping timeout: 260 seconds]
mon_aaraj has joined #commonlisp
scymtym has joined #commonlisp
treflip has joined #commonlisp
Posterdati has joined #commonlisp
mon_aaraj has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
mon_aaraj has joined #commonlisp
livoreno has joined #commonlisp
rodicm has joined #commonlisp
<contrapunctus>
Hm, I'm at a loss.
lisp123 has joined #commonlisp
axel-bee has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
axel-bee_ has joined #commonlisp
axel-bee_ has quit [Client Quit]
aartaka has quit [Ping timeout: 272 seconds]
aartaka has joined #commonlisp
<contrapunctus>
What I want is to be able to get the information the `definitions` system provides (definition type, name, argument list, docstring)...but for a form returned by `read`. As it happens, I'm also loading the files containing the forms before reading them, so it's possible to use `definitions`...
<contrapunctus>
...as long as I can avoid calling `find-definitions` for, say, an `in-package` call. Which means I'd have to check that the form is a "definition", by e.g. checking that the first element of the list matches some known keywords like `defun`, `defmethod`, etc...
<contrapunctus>
...but since newer definition types can be defined by the programmer, it doesn't seem like a very elegant approach - the keyword map would have to be updated for them (in addition to defining a new definition class) /o\
<pjb>
contrapunctus: or at your implementation user manual.
hashfunc16b8 has joined #commonlisp
mixotricha has quit [Ping timeout: 252 seconds]
livoreno has quit [Ping timeout: 250 seconds]
livoreno has joined #commonlisp
<contrapunctus>
pjb: hm...are you sharing that so I get a list of built-in definers?
<contrapunctus>
Shinmera: would it makes sense for `definitions` to have a slot containing the "definer" symbol? e.g. it would have the value `defmethod` for methods, `defun` for functions, etc...that might be one way to resolve this 🤔️
<Shinmera>
contrapunctus: that seems only helpful for your very specific thing.
<contrapunctus>
it does :\
<Shinmera>
Definitions already includes an API to return the definition location within a source file though, so not sure what else you want.
mon_aaraj has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
<pjb>
contrapunctus: well, I don't know the definition system and what it is able to do, but the point is that it's up to you to register the definitions you're reading.
hashfunc16b8 has quit [Remote host closed the connection]
makomo has joined #commonlisp
Colere has quit [Ping timeout: 260 seconds]
Th30n has quit [Ping timeout: 256 seconds]
notzmv has joined #commonlisp
random-nick has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
Colere has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 246 seconds]
cage has joined #commonlisp
lisp123 has joined #commonlisp
<lisp123>
pjb: thanks
mixotricha has joined #commonlisp
<jackdaniel>
Shinmera: will there be a kickstarter tier: [all of the above, and the swank server listens on port 4006]? (no need to answer, I'm joking)
shka has quit [Read error: Connection reset by peer]
shka has joined #commonlisp
mixotricha has quit [Quit: Client closed]
Fare has quit [Quit: Leaving]
rodicm has quit [Quit: Leaving]
<Shinmera>
You are joking, but I'm not: there's a stretch goal for modding, which definitely includes support for that kinda thing
<hayley>
I wonder how hard it is to make a SBCL executable forget that it has a custom toplevel function. Just wondering.
lisp123 has quit [Remote host closed the connection]
cage has quit [Remote host closed the connection]
cage has joined #commonlisp
rainthree3 has quit [Quit: Leaving]
cage has quit [Remote host closed the connection]
cage has joined #commonlisp
lisp123 has joined #commonlisp
em7 has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #commonlisp
em7 is now known as mm007emko
Oddity has quit [Ping timeout: 248 seconds]
livoreno has quit [Ping timeout: 248 seconds]
treflip has quit [Quit: work work]
leeb has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
leeb has quit [Ping timeout: 260 seconds]
bendersteed has quit [Remote host closed the connection]
bendersteed has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
Krystof has quit [Ping timeout: 252 seconds]
bendersteed has quit [Ping timeout: 260 seconds]
dec0d3r has joined #commonlisp
aartaka has joined #commonlisp
artchad has joined #commonlisp
Bike has joined #commonlisp
qhong` has quit [Ping timeout: 244 seconds]
qhong has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
igemnace has quit [Remote host closed the connection]
Algernon69 has joined #commonlisp
Algernon69 has quit [Client Quit]
Krystof has joined #commonlisp
chimp_ has quit [Read error: No route to host]
Th30n has quit [Quit: WeeChat 3.5]
jack_rabbit has quit [Read error: Connection reset by peer]
bendersteed has joined #commonlisp
Brucio-61 has quit [Ping timeout: 250 seconds]
scymtym has quit [Ping timeout: 258 seconds]
mm007emko has quit [Quit: Client closed]
dec0d3r has quit [Quit: Leaving]
bendersteed has left #commonlisp [ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)]
livoreno has joined #commonlisp
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
thuna` has joined #commonlisp
dBc has joined #commonlisp
rotateq has joined #commonlisp
dBc is now known as Aquarne
Aquarne has quit [Quit: leaving]
Aquarne has joined #commonlisp
Aquarne has quit [Client Quit]
Aquarne has joined #commonlisp
igemnace has joined #commonlisp
morganw has joined #commonlisp
Guest95 has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
<Guest95>
Hi, have a question about CLOS. From https://lispcookbook.github.io/cl-cookbook/clos.html I get the impression that if I create a custom initialize-instance method with the :around option for a class, the returned value from that method will be output by calling make-instance on that class. However, I find that's not what happens when I do
<Guest95>
make-instance
citizenandrew has joined #commonlisp
<Guest95>
For example, if I do this: (defmethod initialize-instance :around ((obj obj-class) &key) ... 33)
<Guest95>
I would expect (make-instance 'obj-class ...) to return 33, but instead it just returns an instance of obj-class
<Bike>
your impression is not correct. make-instance returns the new instance, not the return value of initialize-instance.
<beach>
No, MAKE-INSTANCE calls ALLOCATE-INSTANCE and returns the value of that call. It then calls INITIALIZE-INSTANCE with that object, but doesn't use the return value of INITIALIZE-INSTANCE.
<rotateq>
I never used :around with that yet, but :after. Let me see where they mention it.
AndrewYu is now known as Andrew
<Bike>
initialize-instance is also defined to return the instance it's given, so having an around method return something else is technically undefined behavior.
<Guest95>
Ok, so if if I overload allocate-instance I can customize the return value in that way?
<Bike>
Sure
<beach>
Guest95: You wouldn't want to call INITIALIZE-INSTANCE on 33 though.
<Guest95>
So then (defmethod allocate-instance ((obj obj-class) &key) ... 33)
<Bike>
No, allocate-instance takes the class of the object, not the object
<Bike>
since it does, after all, _make_ the object
<Bike>
You'll need a custom metaclass
<Guest95>
Ok, it just takes the class. Does it receive the keyword arguments?
<beach>
I believe it does, yes.
<beach>
But again, returning 33 from ALLOCATE-INSTANCE won't work.
<Guest95>
It has to be a class instance?
<beach>
Because then, MAKE-INSTANCE will pass 33 to INITIALIZE-INSTANCE which does not have a method that is applicable to 33.
<Bike>
you'd have to define methods on initialize-instance, shared-initialize, etc that are totally distinct from the standard methods.
<beach>
33 is a perfectly valid class instance, but not an instance of a class that INITIALIZE-INSTANCE has a method for.
<Bike>
but you can't specialize initialize-instance on integer, since that's a standard class you're not allowed to futz with.
<citizenandrew>
I'm trying to wrap my head around the compiler for petalisp. It's a really fun project, but it is breaking up computations into intermediate steps in a way that leads to pretty slow compute times for my use (>10x slower than a very naive version). Has anyone here played with it?
<Guest95>
Got it, so if I pass it a class instance that's compatible with initialize-instance it'll work
<beach>
Yes.
<beach>
mop initialize-instance
<specbot>
Couldn't find anything for initialize-instance.
<beach>
Bah!
<Bike>
i don't think amop describes i-i any farther than the standard
<beach>
Yeah.
<Guest95>
That should work for me, thanks, lastly Bike what were you saying about needing a custom metaclass?
<Bike>
well, you want to define a method on allocate-instance, right. that takes a class as an argument. so you need to specialize on the class of the class, i.e. the metaclass.
<citizenandrew>
Of course the instant I ask the question I figure it out... there is a kernel-size-thershold that I can tune. Now back to benchmarking
<rotateq>
beach: You mean cause initialize-instance has defined effect for standard-objects rather than also built-in-class?
<beach>
rotateq: Something like that. I forget the details.
utis has joined #commonlisp
<beach>
Exactly!
<beach>
It has a method specialized to STANDARD-OBJECT.
<Guest95>
Ok, so specialize on the ancestor class of the class I'm targeting
<Bike>
no, the metaclass. it's not a superclass, if that's what you mean by "ancestor"
<beach>
Guest95: No, the metaclass, but you are not allowed to specialize to an existing specified class.
<rotateq>
Phew, I feared I got something wrong again. :/
artchad has left #commonlisp [ERC 5.4 (IRC client for GNU Emacs 28.1)]
<Guest95>
Ok, I'm not clear on what the metaclass would be. If the class I wish to define a special allocate-instance method for is obj-class, what arg would I specify in the (defmethod allocate-instance ...) invocation?
<Bike>
whatever the class of obj-class is.
<Bike>
(class-of (find-class 'obj-class)), try it out
frgo has quit [Read error: Connection reset by peer]
<Bike>
but like beach says, if it's standard-class you can't write a new method on that since it's standard. so you'll need a custom metaclass like i said.
<beach>
I guess and EQL specializer with (find-class 'obj-class) would work.
<Guest95>
Ok, it's common-lisp:standard-class
<Bike>
beach: i think that would violate the MOP restriction about specializing?
<beach>
You may be right.
<beach>
Guest95: Yes, and STANDARD-CLASS is, well, a standard class, so you are not allowed to use it as a specializer.
<Guest95>
So I can't do (defmethod allocate-instance ((this-class standard-class) &key) ...stuff...) because it would affect every class
<beach>
Because the standard says it is not allowed.
<Guest95>
Hence I need to create a new metaclass and make my classes instances of that metaclass
<rotateq>
But an instance of standard-class is of type standard-object too, or I get something wrong.
<beach>
rotateq: That's correct.
<rotateq>
beach: Good, it can be a bit confusing the first times.
<beach>
Guest95: That seems to be the only way, yes.
<beach>
Ouch, I said the wrong thing.
<beach>
You should have said "But an instance of a standard class (i.e., and instance of an instance of standard-class) is of type standard-object too.
<rotateq>
Okay.
<beach>
rotateq: But the other way around is not necessarily true. An instance of STANDARD-OBJECT is not necessarily an instance of a standard class.
<Guest95>
That makes sense, appreciate the help
<rotateq>
beach: Right, I have that in mind.
<beach>
rotateq: For example, in SICL things like arrays and hash tables are standard objects, but ARRAY and HASH-TABLE are not standard classes.
<beach>
Guest95: Pleasure.
<rotateq>
Guest95: Was the Cookbook entry your first encountering with CLOS? (as it's about you atm)
<utis>
with lquery, how would one replace every text between <foo> . . . </foo> with the result of giving it to a function?
<Guest95>
rotateq: I've read about it in some of the other guides as well, like PCL
<rotateq>
Okay cool.
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
leeb has joined #commonlisp
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
mrcom has quit [Remote host closed the connection]
mrcom has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
causal has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
orestarod has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
Guest95 has quit [Ping timeout: 252 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<rendar>
can we say that the one of the core power of lisp is that it can interpret user's strings (or list, or data in general) as lisp code itself, just like in C i would have const char * i = "int x=2;";
<Bike>
most programs don't actually need that capability, but it is ncie to have, yes.
<jackdaniel>
there is that thing called casting bytes to a function in C (of course that's an undefined behavior)
<rendar>
but isn't that one of the core features that let people to love lisp?
<Bike>
dunno what people like, but i can tell you i've barely ever used EVAL.
rodicm has quit [Ping timeout: 240 seconds]
* jackdaniel
likes typing characters '(' and ')'
<rendar>
:)
<Bike>
you can use eval in javascript too, among many other language.s
<rendar>
yep
<rendar>
but one guy said writing lisp is like having access to the AST
<jackdaniel>
that guy probably had in mind macros
<rendar>
yeah i think so
<jackdaniel>
so, macros would be more like #define FOO(x) (x+x), but not in a dumb preprocessor but rather as part of the runtime (having access to the actual programming language)
artchad has joined #commonlisp
<White_Flame>
rendar: it's not just execution of given strings, but rather that the code is in a data format (just lists) and thus you can generate, transform, and manipulate code super easily
<dlowe>
rendar: the core power of lisp is that its tokens are data objects and not text
leeb has quit [Ping timeout: 248 seconds]
<White_Flame>
and that eliminates things like boilerplate code completely, allowing your code to just programmatically generate it for you
<White_Flame>
and the regularity of the s-expression, ast-like representation means you can extend the language however you want very easily
<White_Flame>
either for utilities or fully separate DSLs
<White_Flame>
many of the other great features of lisp have been adopted by other languages over the decades, but not the homoiconic ones
<rendar>
i see
<White_Flame>
*but they haven't adopted the homoiconic features/advantages
<rendar>
that's very interesting
<jackdaniel>
I think that it would be more correct to say, that languages that have adopted its homoiconic features were cheerfully dubbed lisps
Oddity has joined #commonlisp
<rendar>
if i got it, haskell takes a lot from lisp, expect for ( ) mandatory, and many functions are used as operators, is this right?
<jackdaniel>
I don't think that haskell takes a lot from Lisp
<White_Flame>
jackdaniel: prolog is the only other major language that's homoiconic and not sexpr as far as I know
<Shinmera>
I've used macros in Elixir and Rust and it's definitely far more of a headache. Not even considering that you can't do arbitrary function usage in those macros.
<rendar>
i see
<jackdaniel>
rendar: haskell is statically typed and that's somewhat not well aligned with CL (however there are statically typed lisps, so well)
<White_Flame>
people make an argument for forth & tcl as homoiconic with the input string as its unifying data structure, but I don't buy that as much
<mariari>
some forth derivatives are homoiconic, like factor
<mariari>
factor has first class macros even
<rendar>
it seems Julia is
<mariari>
rendar: ML in general is derived from wanting to type lisp, but has moved away from lisp over time
<jackdaniel>
I don't know what is homoiconic in Julia, but mkay
<rendar>
mariari, yes, indeed derivatives of ML of today (Scala, OCaml, F#) have few in common with common lisp (pun not intended)
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<mariari>
I wouldn't really consider Scala a derivative of ML. It takes many ideas, yes, but is more in line with the ALGOL family in many ways
Oddity has quit [Ping timeout: 255 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
cosimone has quit [Remote host closed the connection]
Dynom has joined #commonlisp
ttree has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
Noisytoot has quit [Ping timeout: 276 seconds]
Aquarne has quit [Ping timeout: 248 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
Noisytoot has joined #commonlisp
lisp123 has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
thuna` has quit [Ping timeout: 240 seconds]
lisp123 has quit [Ping timeout: 255 seconds]
waleee has joined #commonlisp
Madsy has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<contrapunctus>
How do I tell Trivia that an element may or may not exist? e.g. to match a `defun` form, you can write `(list* 'defun name arglist (and docstring (type string)) _)`, but that pattern does not treat the docstring as optional. You can add another clause like `(list* 'defun name arglist _)`, but this does not scale for situations where you have multiple optional patterns.
<artchad>
I'm using aserve for my website and I'm wondering how to publish a page to an empty URL path. So basically having like a default fallback page.
<artchad>
Something like (publish-file :path "" :file "./html/index.html") doesn't seem to work.
<rotateq>
contrapunctus: I would say it's part of the &BODY argument so it looks if the first element is a simple-string then that is bound to the functions documentation and the rest as the expression body. Does that make sense to you?
<dbotton>
Is there a way for format to display the package. For example:
<dbotton>
CLOG-TYPEAHEAD-ELEMENT
<dbotton>
CL-USER> (format t "~A" 'clog-typeahead:clog-typeahead-element)
<dbotton>
instead of showing clog-typeahead:clog-typeahead-element
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
luna-is-here has quit [Ping timeout: 255 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
cosimone has joined #commonlisp
luna-is-here has joined #commonlisp
<jackdaniel>
you may call (symbol-name <symbol>), or (string <symbol>) ;although it's not format directive
<White_Flame>
dbotton: ~a will only display the name. ~s will show the package if it's not in the current package
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<dbotton>
I see I can use symbol-package to get he package, just have to figure how to turn that to a string, this way don't have to worry if in same package
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
frgo has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
hiphish has joined #commonlisp
hiphish is now known as HiPhish
knusbaum has joined #commonlisp
<HiPhish>
Here there, I just wanted to drop by to advertise my new library cl-cmark. It's a lispy set of bindings for the CommonMark reference implementation cmark.
<HiPhish>
It is not yet at version 1.0, but I am 90% there. The main thing missing is parser options and the documentation. I hope I'll get it done soon enough.
<HiPhish>
Feel free to open an issue on GitLab or GitHub if you want. Goodbye :)
Krystof has quit [Ping timeout: 256 seconds]
<Shinmera>
Not sure I would want to use a parser that requires a foreign library, but then again the commonmark spec is a monster so I can't blame ya for not wanting to write one from scratch.
<HiPhish>
Haha, yes. I fully share that sentiment. I wanted to use a native parser as well, but there is no way I could have written one myself. So it was either this or nothing. I have to say that libcmark is quite pleasant to wrap, it was probably written with the intention to be used that way.
Krystof has joined #commonlisp
<utis>
with lquery, how would one replace every text between <foo> . . . </foo> with the result of giving it to a function?
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
HiPhish has quit [Quit: WeeChat 3.5]
azimut has joined #commonlisp
<Shinmera>
not super pretty but could do something like (lquery:$ (initialize "<foo>abc</foo>") "foo" #'(lambda (node) (lquery:$ node (text "something"))))
<utis>
Shinmera: only looked at the first so far, but this just replaces 'abc' with 'something', right? what i seek is to replace it with (reverse "abc") etc.
rodicm has joined #commonlisp
morganw has quit [Remote host closed the connection]
<Shinmera>
well yeah, but it's a lambda. You can do whatever you want in there.
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<utis>
Shinmera: yeah, if only i can figure out how to access the original text . .
<Shinmera>
you got the node as the argument to the lambda.
<Shinmera>
just get it.
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
<Shinmera>
ah, wait, sorry, I forgot that the direct function just passes the array of nodes. Should be wrapped in a (map ..).
Dynom has quit [Quit: WeeChat 3.5]
<Shinmera>
So something like (lquery:$ (initialize "<foo>abc</foo>") "foo" (map (lambda (n) (lquery:$1 n (text (reverse (plump:text n)))))))
<utis>
goodness
<utis>
thanks!
betonmischa has joined #commonlisp
kpoeck has quit [Ping timeout: 252 seconds]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
yauhsien has joined #commonlisp
dra has joined #commonlisp
tyson2 has joined #commonlisp
yauhsien has quit [Ping timeout: 240 seconds]
yauhsien has joined #commonlisp
pepsi is now known as jamesmartinez
mon_aaraj has joined #commonlisp
lisp123 has joined #commonlisp
morganw has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
rodicm has quit [Quit: Leaving]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
mon_aaraj has quit [Remote host closed the connection]
mon_aaraj has joined #commonlisp
kpoeck has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
artchad has quit [Read error: Connection reset by peer]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
citizenandrew has quit [Remote host closed the connection]
citizenandrew has joined #commonlisp
rogersm has quit [Quit: Leaving...]
citizenandrew has left #commonlisp [#commonlisp]
prokhor_ has quit [Ping timeout: 276 seconds]
makomo has quit [Ping timeout: 256 seconds]
kpoeck has quit [Quit: kpoeck]
adeht is now known as _death
shka has quit [Ping timeout: 240 seconds]
qhong_ has joined #commonlisp
ttree_ has joined #commonlisp
jmiven has quit [Quit: reboot]
makomo has joined #commonlisp
gko` has joined #commonlisp
whereiseveryone_ has joined #commonlisp
Schnouki_ has joined #commonlisp
jasom_ has joined #commonlisp
ggb_ has joined #commonlisp
\f_ has joined #commonlisp
nytpu_ has joined #commonlisp
jmiven has joined #commonlisp
dale_ has joined #commonlisp
theothornhill_ has joined #commonlisp
axvr_ has joined #commonlisp
mcoll_ has joined #commonlisp
chiheisen_ has joined #commonlisp
alethkit_ has joined #commonlisp
patrix_ has joined #commonlisp
srhm_ has joined #commonlisp
sm2n_ has joined #commonlisp
retropikzel_ has joined #commonlisp
griffinmb_ has joined #commonlisp
neominimum_ has joined #commonlisp
payphone_ has joined #commonlisp
ecraven- has joined #commonlisp
gendl_ has joined #commonlisp
nocko_ has joined #commonlisp
conjunctive_ has joined #commonlisp
famicom_guy_ has joined #commonlisp
jkamat has joined #commonlisp
lacedaemon has joined #commonlisp
zagura__ has joined #commonlisp
Faed has joined #commonlisp
neominimum has quit [Ping timeout: 250 seconds]
retropikzel has quit [Ping timeout: 250 seconds]
griffinmb has quit [Ping timeout: 250 seconds]
whereiseveryone has quit [Ping timeout: 250 seconds]
jasom has quit [Ping timeout: 250 seconds]
alethkit has quit [Ping timeout: 250 seconds]
axvr has quit [Ping timeout: 250 seconds]
nocko has quit [Ping timeout: 250 seconds]
pl has quit [Ping timeout: 250 seconds]
ecraven has quit [Ping timeout: 250 seconds]
jgkamat has quit [Ping timeout: 250 seconds]
nytpu has quit [Ping timeout: 250 seconds]
sm2n has quit [Ping timeout: 250 seconds]
famicom_guy has quit [Ping timeout: 250 seconds]
ggb has quit [Ping timeout: 250 seconds]
patrix has quit [Ping timeout: 250 seconds]
conjunctive has quit [Ping timeout: 250 seconds]
son0p has quit [Ping timeout: 250 seconds]
deadmarshal has quit [Ping timeout: 250 seconds]
payphone has quit [Ping timeout: 250 seconds]
Fade has quit [Ping timeout: 250 seconds]
qhong has quit [Ping timeout: 250 seconds]
dale has quit [Ping timeout: 250 seconds]
srhm has quit [Ping timeout: 250 seconds]
mcoll has quit [Ping timeout: 250 seconds]
theothornhill has quit [Ping timeout: 250 seconds]
chiheisen has quit [Ping timeout: 250 seconds]
\f has quit [Ping timeout: 250 seconds]
gko has quit [Ping timeout: 250 seconds]
zagura has quit [Ping timeout: 250 seconds]
gendl has quit [Ping timeout: 250 seconds]
ttree has quit [Ping timeout: 250 seconds]
phoe has quit [Ping timeout: 250 seconds]
neominimum_ is now known as neominimum
jasom_ is now known as jasom
fe[nl]ix has quit [Ping timeout: 250 seconds]
axvr_ is now known as axvr
alethkit_ is now known as alethkit
Schnouki has quit [Ping timeout: 250 seconds]
retropikzel_ is now known as retropikzel
payphone_ is now known as payphone
dale_ is now known as dale
\f_ is now known as \f
mcoll_ is now known as mcoll
chiheisen_ is now known as chiheisen
Schnouki_ is now known as Schnouki
srhm_ is now known as srhm
neominimum has joined #commonlisp
theothornhill_ is now known as theothornhill
neominimum has quit [Changing host]
griffinmb_ is now known as griffinmb
patrix_ is now known as patrix
sm2n_ is now known as sm2n
gendl_ is now known as gendl
phoe has joined #commonlisp
phoe has quit [Changing host]
phoe has joined #commonlisp
pl has joined #commonlisp
pve has quit [Quit: leaving]
opcode has quit [Ping timeout: 255 seconds]
deadmarshal has joined #commonlisp
opcode has joined #commonlisp
<mfiano>
What is the correct way to get the next applicable method that would be called if in a primary method I did: (when (next-method-p) (call-next-method)) ?
<mfiano>
I would like to know if my method organization is correct, and tracing this large mess is a bit confusing
lisp123 has joined #commonlisp
<pjb>
mfiano: compute-applicable-methods
<mfiano>
Wasn't the list already computed by the call to next-method-p? I only want the next one it already computed.
<Bike>
next-method-p doesn't compute anything. the method is passed a list of the next methods.
lisp123 has quit [Ping timeout: 240 seconds]
<Bike>
if you want the actual method object, there is no standard way to do that.
<Bike>
you could finagle one with MOP, but it would be way too much work for what you want it for. you should use compute-applicable-methods or maybe method-combination-utilities:method-combination-expand
<mfiano>
Ok
<Bike>
(specifically, you should use compute-applicable-methods outside the method body, like in the repl)
orestarod has quit [Ping timeout: 260 seconds]
pillton has joined #commonlisp
tyson2 has joined #commonlisp
random-nick has quit [Ping timeout: 260 seconds]
Lord_of_Life has quit [Ping timeout: 246 seconds]
nocko_ is now known as nocko
Colere has quit [Ping timeout: 246 seconds]
Colere has joined #commonlisp
Lord_of_Life has joined #commonlisp
<mfiano>
Realization: I did a complete 180 in the last 2 years with regard to how I program Common Lisp.
tyson2 has quit [Remote host closed the connection]
<mfiano>
I used to be focused too much on performance, using FTYPE'd functions, structs, and the likes. Now, nearly every function I write is a generic function, for many reasons, but the most interesting one for me is to get no applicable method errors signalled when I do something wrong, rather than have wrong values propagate through the stack making it harder to debug.
dra_ has joined #commonlisp
<mfiano>
garbage-in/garbage-out is a horrible way to write software.
zagura__ is now known as zagura
dra_ has quit [Client Quit]
dra_ has joined #commonlisp
dra has quit [Killed (NickServ (GHOST command used by dra_!~dra@2a04:4540:6416:3900:384a:4f55:c90d:c79d))]
mixotricha has joined #commonlisp
dra_ has quit [Client Quit]
dra has joined #commonlisp
dra has quit [Quit: Leaving]
molson_ has joined #commonlisp
molson has quit [Ping timeout: 240 seconds]
morganw has quit [Remote host closed the connection]