libera/#commonlisp - IRC Chatlog
Search
1:47:48
jcowan
If there were such direct instances of T, the CLOS structure would be somewhat leaky.
1:48:06
pillton
jcowan pfd: I recommend the book, The Art of the Metaobject Protocol. It covers the design of CLOS and offers a number other nuggets which are useful for designing/structuring APIs.
1:51:12
pillton
I don't know what "leaky" means, but CLOS doesn't permeate through the language. For example, you cannot inherit from a system class.
1:51:23
pfd
Same here. I need to re-read that seminal book. I've been leaning too heavily on the basics _Understanding CLOS_ Lawless/Miller book, mentioned above, which I was fortunate to scoop for not too dear a few years ago.
1:55:36
Guest74
I don't even know how to begin to debug this. https://imgur.com/a/YSSKrPk I think I'll just start selling them.
1:57:00
jcowan
However, CONDITION is a class in the class hierarchy: a condition object is of class CONDITION.
2:02:56
pillton
jcowan: Sure, but it isn't required to be an instance of STANDARD-OBJECT nor any of the standard meta objects.
2:07:25
pillton
Actually, I might have to check my definition of the CLOS. I might be using it incorrectly. My definition of the CLOS is as defined in Chapter 7 of the standard. I am not sure if that is correct.
2:10:09
jcowan
In what sense can a statement in the standard be said to be "incorrect" (outside errata)?
3:02:12
beach
pfd: If you have trouble bootstrapping SICL, you can ask questions in #sicl. There shouldn't be any particular problems, but I forgot to push a change to Trucler for a few days and that broke things.
3:27:55
pfd
No. I love Indian culture, and I agree with the Russia-India cooperation around energy and ruble-rupee workaround!
3:27:56
pfd
I'm Greek/Hellenic born in Germany, and brought up in Toronto, Canada, where I still am.
4:51:14
char[m]
Is there some library that facilitates immutable clos? I'm looking for something that will allow me to make a copy of an object while modifying some of the slots of the copy.
5:23:31
Josh_2
Can anyone help me out with my macro defining macro, I am trying to pass a class name into the body of the second macro but if I use ,,<class var> I end up with ,<class>
5:38:44
char[m]
For anyone else, generic-cl's copy fist the bill pretty well. It would be better if it was automatic though.
5:39:53
mfiano
LOCALLY is not serving any purpose here. Why are you generating FUNCALL in a quasiquoted form where the operator is known?
5:42:02
mfiano
Why is it that you are calling these slot values. Slots are implementation details that shouldn't be exposed, and you shouldn't be associating an accessor with the concept of a slot value. For example, an AROUND method could easily break that association.
5:42:59
Josh_2
How about you help me with my problem, and then perhaps say "hmm maybe you should give your methods a different name"
5:43:02
mfiano
With that said, you shouldn't ever need to ",,". Break it up into functions that generate the code for you.
5:45:04
pillton
I'd probably take a step back and ask more fundamental questions. This looks like the wrong way to implement this.
5:51:00
pillton
It looks like you're are trying to make it easier to implement a method for VALIDATE-PAYMENT-INTENT-SLOT.
5:53:49
pillton
I am certainly not advocating copying and pasting. I can't see what you're copying and pasting nor do I have a mental model of the abstraction you're trying to create.
5:55:44
mfiano
"How about you help me with my problem...": The problem is usually more fundamental than what is asked, and we are all volunteers here. I am not obligated to help any way other than how I know to break down a problem, when I have the time.
5:56:19
mfiano
I understand the frustration coming here after trying something that failed, but that is no way to ask for help.
6:00:07
pillton
I don't have an issue with how you asked your question. Your question and code just highlights bigger issues that you need to pause and think about.
6:02:32
pillton
Well you can approach your problem as a complication I can live with today, or you could use your problem to learn something from others about how to create abstractions.
7:47:24
lisp123mobile
i guess i could convert to string and count the length but that seems expensive
7:51:15
lisp123mobile
so my unique id function is complete - start with universal time and add a global counter to it (adjusting for its number of digits)
7:55:55
jackdaniel
if you have sessions to be persistent with then you may also store the global counter value
7:56:38
rotateq
you *could* write as another possibility a WITH-FOO macro that starts with (let ((*gensym-counter* 0)) ...). maybe, or I don't understand the problem
7:58:42
zeroc00l0
What happens if the program starts, creates an id, crashes, restarts, creates an id, all within the same unit of the system clock?
7:59:37
rotateq
beach: Yes I thought on that too and wrote them in query, but it was not directly what he asked for. So your advises to me sink in. :)
8:00:39
lisp123mobile
jack daniel: specifically the problem is i can’t store global id in a bknr data store and then use it in another store object. and i don’t want to write to file or another persistent storage for this
8:02:17
lisp123mobile
jack daniel: ok will have another look, i wonder how it compares speed wise vs using a combo of time / counter
8:04:11
jackdaniel
for class-allocated slots you need an instance too, but the slot is shared across all instances
8:05:53
lisp123mobile
but it’s annoying with bknr because i need to update it outside of the object creations
8:07:32
lisp123mobile
uuid is probably the cleanest way, as you say it avoids ironclad for the basic functionality
8:18:45
mfiano
Shamelesss plug: Fast, MIT-licensed UUIDv4 encoder/decoder: https://github.com/mfiano/common-lisp/tree/master/misc/uuid
8:21:19
mfiano
I should probably remove the dependency on seedable-rng. That isn't very attractive :/
9:09:44
jackdaniel
that is my impression - it generates the spec file that may be distributed with the project
9:09:47
Nilby
libc is big and wrapping all of libc in lisp is mostly pointless, since the native CL are usually preferable. usually people pick the few function they need and wrap those.
9:10:41
_death
beach: re. LOG I noticed the other day that its implementation in sbcl is weird.. (log n 2) basically translates to (/ (log n) (log 2)) i.e. it evaluates (log 2) each time.. so I resorted to doing (defun lg (x) (* (log x) #.(/ (log 2))))
9:11:28
jackdaniel
Nilby: that's when you want to deal with writing bindings, automatic wrappers are a nobrainer solution for trivial-foolib-bindings
9:18:45
rotateq
maybe I should rename my newer repo for emulating Racket loop types to "trivial-racket-loops" :)
9:20:19
jackdaniel
imo libs and features ported from scheme/racket to cl should be called unhygienic-<something>
9:21:37
jackdaniel
lisp123: clearly someone who did not like common lisp. to turn the coin, it could be called 'sterilze' as an opposite to 'organic'
9:36:36
zacque
Nilby: But if that function is being used again and again across many libraries, won't that cause a lot of code duplication?
10:57:35
mange
Hi! Does anyone feel like helping me work out a MOP issue I'm having? I'd like to choose a different effective slot definition class depending on the values of fields in my direct slot definition. Is there a better way to do it than communicating down the stack with a special variable bound in an around method on COMPUTE-EFFECTIVE-SLOT-DEFINITION?
10:58:58
mange
I've tried redefining COMPUTE-EFFECTIVE-SLOT-DEFINITION's primary method, which can work but doesn't seem portable. I've also tried using CHANGE-CLASS to change the slot into the type that I want after it's made but SBCL explicitly checks for and rejects that.
11:46:01
jackdaniel
zacque: check out l1sp.org , it is a metasearch for clhs, mop and a few other specifications
11:46:14
beach
Sure. When I was implementing CLOS, I was going crazy trying to use the AMOP book. So I created the site to keep my sanity.
11:47:02
jackdaniel
beach: did you type things by hand, copy from pdf or you've converted some existing source code to make clos-mop?
11:48:20
rotateq
And I'm not sure, it was mentioned in the Keene book, when I make a subclass and give additional `:type` option to a slot that comes from the superclass, they are forged together with AND.
11:51:21
zacque
jackdaniel: Thanks! The search query is simply enough, i.e. format = "http://l1sp.org/search?q=%s"
11:55:23
zacque
I guess it needs to scan through every reply for keyword, when there is a match, it then replies with the matching item