libera/commonlisp - IRC Chatlog
Search
9:24:01
beach
That's a very strange question. I mean, the answer is "Of course, it happens all the time. Just look at something like PRINT-OBJECT."
9:27:00
beach
The use of special variables is no different from the use of special variables in ordinary functions.
9:27:12
beach
The use of special variables in methods is no different from the use of special variables in ordinary functions, I mean.
9:29:54
beach
I don't see the relation between &ALLOW-OTHER-KEYS and special variables. Also, &ALLOW-OTHER-KEYS is not reserved for methods. It is used in ordinary functions as well.
9:31:05
lisp123
I was thinking of allowing people to override the primary method based on giving them flexibility in &allow-other-keys
9:35:38
lisp123
Where it is different from normal functions - there is typically no expectation that an ordinary function would be redefined,so arguably special variables should not be an implicit parameter but rather explicit in the parameter list
9:36:02
lisp123
Whereas with generic functions and the capabilities offered by method combinations, maybe its more appropriate
10:01:21
beach
I think you have a special use case in mind. And I am unable to infer it from the question and the additional descriptions you have given. But then, I am notorious for not understanding what people want, unless the description is very detailed. You can hope that someone else is better with that than I am.
10:13:38
beach
Well, in that case, I can tell you about the technique we have adopted in several libraries. Important generic functions have a CLIENT parameter that is not specialized to by the methods in the library. Client code must supply an instance of a standard class as the argument for this parameter. Client code can then override any method by providing a method that does specialize to the standard class in question.
10:14:04
beach
You can see this technique in Eclector, for instance. But also in Clostrum, Trucler, etc.
10:15:49
beach
Functions that are not allowed to take any additional parameter, such as READ for instance (which must be compatible with the standard one), call a generic function, passing the value of the library-provided special variable *CLIENT* as an argument for this parameter. Client code must bind the special variable around a call to a library function.
10:16:54
beach
This way, the library can supply lots of good default methods for all generic functions, while clients with special needs can override any such generic function.
10:24:41
beach
This technique also allows for several clients to exist simultaneously in the same Common Lisp image. For instance, if I want to cross-compile code for SICL using an implementation that already uses Eclector, then the host can use Eclector with its own client, and the cross compiler can pass a SICL-specific client in order to use Eclector as a reader.
10:26:05
lisp123
Important generic functions have a CLIENT parameter that is not specialized to by the methods in the library. -> When (or what factors drive the decision) of when this should be an explicit parameter vs. a special *CLIENT* variable
10:27:56
phoe
so, (let ((eclector:*client* foo)) (cl:read ...)) is equivalent to (eclector:read-with-client foo ...)
10:28:09
beach
If the library function is not trying to imitate the lambda list of any known function, then it can freely use a CLIENT parameter.
10:28:21
lisp123
I get that part for functions that are not allowed to take an additional parameter, but reading the above it seems like its preferable in other cases to make the CLIENT parameter explicit
10:28:39
phoe
when you can't do anything else, though, the oldest trick in the book, one of passing extra arguments via dynamic variables
10:29:58
lisp123
So I guess instead of specialising on keys, the all-encompassing client parameter captures variations
10:31:29
lisp123
(defgeneric foo (object &key &allow-other-keys) -> (defmethod foo ((object class-b) &key (x 1) (y 2) &allow-other-keys)
10:32:05
phoe
yes, but not all functions have &KEY so you cannot use arbitrary keys to configure their behavior
11:56:33
mfiano
Is there a portable utility function floating around somewhere that linearized a rank>1 array into a rank 1 array (or vector if need be)?
11:57:40
mfiano
Since Common Lisp doesn't support ragged matrices, it should literally be what most implementations would store in row-major ordering anyway.
11:58:59
mfiano
I just thought this would be a common enough pattern to have a utility around for it. It's common in things I do anyway, so just curious before I add a todo to add it to my utility library.
12:04:09
mfiano
The array-operations library is now maintained by @Symbolics as part of the Lisp-Stat project. The new repository is https://github.com/Lisp-Stat/array-operations.
12:05:23
phoe
https://github.com/bendudson/array-operations/compare/master...Lisp-Stat:array-operations:master#diff-4673a3aba01813b595de187a7a6e9e63a3491d55821606fecd9f13a10c188a1d
12:10:08
phoe
MIT license says, "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."
12:11:06
mfiano
the Software pertains to the source code. As it is. Right then and there. The revision with that license still exists.
12:12:39
phoe
that would imply everyone redistributing this fork of aops without the whole git repository is now in violation, quicklisp included
12:13:57
phoe
containing a substantial portion of the Software, and therefore still guarded by the old license
12:15:32
mfiano
It seems you are correct. Quicklisp is violating the terms of some Microsoft agreement. Oops.
12:16:13
phoe
seems like lisp-stat is not respecting the MIT license; they're okay with changing to MSPL, they're not okay with removing the MIT license notice
12:17:07
pjb
mfiano: so you want a library for (make-array (reduce #'* (array-dimensions arr)) :displaced-to arr) !?!?
12:17:25
mfiano
Only thing that could happen is flag the repo, MS notices, kid gets sued, up to court to decide if substantial has been met
12:17:30
pjb
mfiano: there you are: (defun linearized-array (arr) (make-array (reduce #'* (array-dimensions arr)) :displaced-to arr))
12:19:35
phoe
the fact that a license is named MSPL and originates at MS doesn't mean that MS itself gets to do something when someone violates it
12:27:36
mfiano
As I said, it is that response that would might (unlikely) cause just enough attention for the 7 moons to align, leading to a court to decide if they made enough substantial changes.
12:28:49
phoe
not really my problem, truth be told; more of a problem of #.(ql:who-depends-on "array-operations") who might want to know that their dependency changed its license from MIT to MSPL
12:29:11
mfiano
I don't care what license it is. It's sketchy that they removed it in violation. And the new license is kinda sketchy too after reading it.
12:32:47
mfiano
I kinda think sharplispers should take over the archived repo, and rebase any worthwhile new changes by the new maintainer
12:36:32
mfiano
Yes, I was just stating that it is recently abandoned/forked, and that change was made _prior_ to that, which is a little unfortunate
12:52:38
jackdaniel
mfiano: it seems that you follow steps of the original creator of array-operations (https://www.tamaspapp.eu/post/common-lisp-to-julia/) :)
12:58:45
mfiano
pjb: No, I don't want any shared structure with the original. I want to retain its simple-array property when possible, also, so big no to displacement.
14:32:46
pjb
mfiano: then just add a copy-seq: (defun linearized-array (arr) (copy-seq (make-array (reduce #'* (array-dimensions arr)) :displaced-to arr)))
14:44:09
jackdaniel
(subclassp style-warning silly-condition) ; boing, silly condition is not a class
14:46:16
jackdaniel
a simple-minded condition system would not check for types at all and leave that for higher level constructs
15:06:11
phoe
but yeah you might want to ask him directly; I've seen gigamonkey say a thing or three here in the past few years but he hasn't really been particularly active AFAIR
15:07:57
random-jellyfish
not sure I understand, Peter Norvig goes by the nickname gigamonkey in here?
15:10:10
phoe
random-jellyfish: please disregard everything I've said since it refers to Peter Seibel
15:21:55
random-jellyfish
how does it do the replacement? each word is replaced by a random non-sense latin word? or does it work at sentence level?
15:27:11
_death
hmm, why would one want to do that? upload confidential documents? if the same word translates to the same replacement word, some information is preserved..
15:31:01
splittist
It's a thing I use so I can work on realistic documents in my private life without taking home company-confidential stuff. I agree it requires trusting me. But I do! (:
15:37:04
_death
ok, but may also want to note that it may not be so difficult to recover at least part of the text
15:43:09
splittist
_death: I tried in the bit that says it is not a cipher, and should not be used as a means of encryption. But perhaps I should just delete "confidential" at the top.
15:46:04
_death
splittist: right, it's not a cipher because the function is not 1-to-1.. each lorem ipsum word is a bucket of original words, and you can try and figure out sentences probabilistically
15:50:01
splittist
It's not very sophisticated at all, of course: https://github.com/splittist/loremizer . In particular, it uses Word's idea of a run, which might encompass a whole word, or might split a word into a number of parts, depending on editing history, phase of the moon etc.
16:09:57
Nilby
as my "Word" is my bond, your confidential documents are 365% safer from lions when you upload them to the herd with everyone else's confidential documents.
16:52:19
pve
Hi, I'm exploring some ideas about "file-local" effects. Here's the first one I made. I'd like to hear thought on this.. is it useless or could there be something here worth exploring further?
16:53:24
pve
the idea is to make the code a bit more brief by having a shorthand for the long protocol name
17:02:03
pve
beach: I thought about that, I could see situations where the protocol is not in a separate package. Also, sometimes packages are designed to be "USE"d, and I don't know if package-local-nicknames would help there.
17:03:01
beach
I see. I think I always put a protocol in a separate package. And I specifically design packages not to be USEd. That's why I didn't see the use case.
17:26:00
_death
splittist: btw, since the processor operates a single-pass word by word, extending the buckets, it is a simple substitution cipher up until the first reoccurrence of a bucket label.. then either the bucket is extended or the word was already seen, and so on.. this could make recovery even easier than what I considered from the description