freenode/#lisp - IRC Chatlog
Search
23:05:48
pjb
/topic would display: *** Topic for #lisp: Common Lisp, the #1=(programmable . #1#) programming language <http://cliki.net/> logs:<https://irclog.whitequark.org/lisp, http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.0, CMUCL 21b, ECL 16.1.3, CCL 1.11
23:11:19
rlp10
Oh it makes sense now. When you said I had a strange "erc client", you meant that I had a strange "IRC client". You would recommend ERC, which is what you use.
23:12:13
rme
https://trac.clozure.com/ccldoc talks about ccldoc. ccldoc's official repository is https://github.com/Clozure/ccldoc
23:17:36
lerax
Hey guys, how work adding a independent software distribution on QuickLisp? There is some place with this well documented? I didn't find on the main page of quicklisp official website.
23:32:08
lerax
"You will be able to make your own private repositories of Quicklisp software (called dists), but it's not documented right now. "
23:32:56
earl-ducaine
I think the bigest criteria are: 1) make sure everything is free and you have basic project info set up; 2) make sure that the project build under quicklisp using the :verbose t setting; 3) make sure that it runs under at least 2 (preferably more) Lisps, eg. CCL and SBCL
23:32:58
lerax
(I'm no trying publishing a package, but creating a private "channel" distribution of personal softwares)
23:33:47
earl-ducaine
I thought you were wanting to *add* https://github.com/borodust/cl-bodge to the main repo.
23:34:35
lerax
Not actually, it was just a example that cl-bodge create a distribution as you can see on #Installation. But I didn't find docs about that.
23:36:03
lerax
This is just curious for me because I didn't find any documentation about that. There is some blog or repo about that, but completly outdated and obscure.
23:37:12
lerax
But I was expecting (as always) a better documentation about that. But if doesn't exists, I'm ok with that. There is the reason I asked here instead... well, there is no much choice when you didn't find something.
23:38:16
earl-ducaine
definitely, having experimental/unstable elpa packages has turned out to be very productive for the emacs community.
23:44:46
Xach
it is not super complex (i don't think) but it is not written down anywhere but in code
0:01:24
aeth
What's Quicklisp's position on projects that only work with other projects? e.g. climacs, an emacs-like editor, is in Quicklisp so would Quicklisp also host climacs packages if someone ported a bunch of Emacs packages to climacs or something?
0:02:20
aeth
I don't think that particular example is going to happen, but it's definitely possible that some application ecosystem or Rails-like framework ecosystem could happen.
0:05:54
aeth
Something along the lines of: What if someone actually did port Emacs Lisp or Guile plugins to some Common Lisp editor, so the asdf systems were thin wrappers over foreign code?
0:08:24
aeth
I'm not sure if that particular thing is going to happen, but I think it's inevitable that non-CL plugins for CL things is coming. There have been some attempts, just not any particularly notable ones, yet.
4:59:32
aeth
earl-ducaine: If you put more than 5 functions in an flet, you probably want to start referring to other functions within that same scope, which labels permits and flet does not
5:02:00
jack_rabbit
If you are doing that, is that not usually a use-case for a separate file for organization rather than flet-ing?
5:04:52
pjb
Depends. The point of flet and labels is that you actually write closures, not mere functions.
5:07:02
aeth
jack_rabbit: Consider repeated calls to a function with a lot of arguments, where a lot of the calls have arguments in common. Creating closures with flet/labels is one way to simplify this code.
5:12:58
aeth
And in this case, labels is better than flet as soon as you have enough to see an even larger pattern.
5:47:28
jack_rabbit
What about passing a data structure around to capture the state rather than relying on closures or passing a bunch of individual values?
6:02:26
aeth
Common Lisp is definitely a language where there's a dozen roughly equivalent ways to do anything
6:14:47
aeth
In this case, I'm drawing shapes, and I decided in the shape API to go with lots of arguments rather than having lots of temporary point objects.
6:15:56
aeth
I probably went overboard and have too *few* objects in the current API, though, so it's a bit messy. I got rid of some of that by using matrices in places.
7:11:55
fiddlerwoaroof
Is there a generic way to get a value for CONCATENATE's first argument that matches the type of the first of the sequences you're concatenating?
7:14:14
fiddlerwoaroof
No, the issue is that the type it gives is too specialized: it includes the length of seq1
7:15:19
fiddlerwoaroof
in the case of vectors, it would have to be (vector (+ (length seq1) (length seq2)...))
7:16:47
aeth
Looks like the perfect use for this library: https://github.com/markcox80/specialization-store/
7:20:53
aeth
(defspecialization foo ((v1 simple-vector) (v2 simple-vector)) (concatenate 'simple-vector v1 v2))
7:21:12
aeth
Well, you probably want that inlined because it's trivial and unchanging and the inline will probably be more efficient.
7:21:32
fiddlerwoaroof
speed doesn't matter too much, and there's a reasonable mapping from class -> result-type
7:21:57
aeth
fiddlerwoaroof: but CLOS generics do not dispatch on types and the classes aren't (afaik) portable, so that's not useful for numbers or sequences, hence specialization-store
7:22:33
aeth
Actually, just noticed, in my foo example, you could probably macroify it to generate all the functions
7:23:04
fiddlerwoaroof
e.g. LIST is a class: http://www.lispworks.com/documentation/HyperSpec/Body/t_list.htm#list
7:23:25
fiddlerwoaroof
As is VECTOR: http://www.lispworks.com/documentation/HyperSpec/Body/t_seq.htm#sequence
7:24:26
aeth
If they have to match in type (but you'd have to generate a name instead of foo): `(defspecialization (foo :inline t) ((sequence-1 ,sequence-type) (sequence-2 ,sequence-type)) (concatenate ,sequence-type sequence-1 sequence-2)))
7:24:43
fiddlerwoaroof
But, it makes more sense to me, just to have a simple function that goes from thing -> symbol
7:26:31
aeth
like (simple-vector 3) -> (simple-vector *) and (simple-array single-float (3)) -> (simple-array single-float (*))
7:27:34
fiddlerwoaroof
Yeah, on sbcl there is the added wrinkle that it's possible for something besides LIST and VECTOR to extend SEQUENCE
7:28:43
aeth
lazy sequences, immutable sequences, very niche sequences like perhaps ordered hash tables or whatever.
7:38:15
aeth
I think for 1D simple-arrays it's always going to be either the cadr (simple-vector) or the caaddr (everything else) so that's just three cases: list, simple-vector, simple-array
7:39:42
aeth
And then I think it's the caddr for the other kinds of vectors (vector whatever-type size)
7:42:57
fiddlerwoaroof
I probably should put this into my utility library, because it's something I've often wanted
7:46:19
aeth
Something like this: (let ((seq (make-array 2 :element-type 'character :adjustable t))) (etypecase seq (list 'list) (simple-bit-vector '(simple-bit-vector *)) (bit-vector '(bit-vector *)) (simple-vector '(simple-vector *)) (simple-array `(simple-array ,(cadr (type-of seq)) (*))) (vector `(vector ,(cadr (type-of seq)) *))))
7:47:28
aeth
the cadr will get the type for simple-array and (not simple) vector, with vector having to come last because of all of the special vectors
7:56:53
aeth
(type-of "hello") => (simple-array character (5)) ; in SBCL with *print-case* as :downcase
7:57:09
fiddlerwoaroof
So, I'm going to go the prescriptive way: you do a typecase and put the most specific types first
7:59:34
fiddlerwoaroof
You could even support extensible sequences by falling back to a generic function call
8:02:02
aeth
Although I think the macro on top of specialization-store implementation quickly becomes more concise than the typecase approach
8:16:17
aeth
well, someone finally noticed a few months ago that almost every post to paste.lisp.org was spam because the captcha was ridiculously weak, like 012354 in a monospace font you can probably parse automatically.
8:16:57
aeth
Pretty much every no-registration thing is full of spam, and a lot of registration things, too. e.g. just about any mediawiki has to deal with tons of spam accounts spamming things
8:17:38
aeth
what I think it should do is require bot-based authentication since the main use is for IRC
8:18:04
aeth
so /msg some-bot please and it'll give me a URL that creates a session, no registration required, but if I spam they'll trace it to my IRC nick. And it's too complicated for general spam bots to bother with
8:19:00
aeth
I think that's simple enough that I could write it in a weekend or so, depending on what system the site uses
10:01:37
francogrex
https://codepaste.net/56qjnv in that snipper, on line 6 when I (cffi:foreign-free buf) which I suppose I should, the results are not maintained anymore, when I remove that, I have what I need. but