freenode/#lisp - IRC Chatlog
Search
0:05:13
Mariaaa
Angel_Feroz(Humbert0@ferozmente.angelical.y.angelicalmente.feroz)- loca de mierda te jodiste te har la vida imposible te ir a buscar y probablemente te desaparezca!!!
0:05:13
Mariaaa
01:45 : Mariaaa 01:38:58 -Angel_Feroz(Humbert0@ferozmente.angelical.y.angelicalmente.feroz)- loca de mierda te jodiste te har la vida imposible te ir a buscar y probablemente te desaparezca!!!
0:16:16
gendl
Hi, I just started using paredit for the first time (after editing common lisp with emacs for 25 years). It seems pretty cool but I should probably read a manual or watch a tutorial - whenever I search for same (even specifying "how to use paredit for common lisp") i'm getting a bunch of nice looking directions on how to use it for clojure.
0:16:52
gendl
that's all well & good and i suppose most of that will apply to CL as well, but is there a nice "paredit for common lisp for dummies" somewhere?
5:09:56
mfiano
Hello all. If I want to sort a list of symbols such that they are sorted lexicographically and ascendingly on both PACKAGE-NAME and SYMBOL-NAME, is it enough to treat the elements as string designators using (sort some-list #'string<), or must I write my own predicate?
5:12:41
mfiano
Just to elaborate, the question is moreso about how a symbol is converted to a string designator, since I want '(mypkg::foo mypkg::bar cl-user::foo cl-user::bar) to be sorted as (cl-user::bar cl-user::foo mypkg::bar mypkg::foo)
5:16:17
White_Flame
but to sort by package, the :key would have to be (lambda (sym) (package-name (symbol-package sym)))
5:18:48
mfiano
I see. Thanks for the suggestion. I was about to resort to that, but was hesitant as while this doesn't occur frequently, when it is, it is being used in the context of a performance-sensitive event loop.
7:46:11
flip214
mfiano: group the symbols by package, then sort the packages and the symbols (per package) separately
10:45:05
ldb
is there any reason most programming langauges treats (expt x 0) const one rather than raise div by 0 error when x is 0?
10:49:51
jackdaniel
in algebra 0^0 usually is treated as 1, often it is left as undefined expression, but I've never heard an interpretation that it is division by 0
10:50:44
jackdaniel
here is even a section about software https://en.wikipedia.org/wiki/Zero_to_the_power_of_zero
10:51:55
jackdaniel
(and, from cl perspective, the answer would be: because it is specified to return 1)
11:03:35
jackdaniel
I mean, that I would find more inuitive that arithmetic-error is signalled, but not necessarily division-by-zero
11:04:23
jackdaniel
or rather, from the specification it seems to be, that division-by-zero shoudl be signalled
11:12:41
galex-713
Beside being older, more used, a lisp-2 (actually lisp-n, afaiu), not having continuation but having goto, and empty list/falsity equivalence, what are the other differences between common lisp and scheme?
11:13:54
jackdaniel
galex-713: common lisp has more predefined functions, longer standard which addresses many practical issues (which are undefined in scheme) and it is a language used by most people here ;)
11:14:52
galex-713
for me that comes with “older”, sorry, I should have been more precise: what are *fundamental* differences, preventing of implementing one in the other fully and respectingly
11:15:29
jackdaniel
galex-713: common lisp is actually "younger" than scheme, however it has lineage which dates before scheme was introduced
11:15:46
galex-713
White_Flame: as of macros, I just consider cl is lower level, I heard you can implement hygienism with defmacro, and can see how, and I saw several scheme implementation providing defmacro-likes
11:16:01
sm2n
I believe someone was talking about their scheme implementation in cl here just yesterday
11:16:52
jackdaniel
'hygiene' suggests something good, but I (as a common lisp programmer) consider it bad, so 'sterile'
11:17:14
galex-713
sm2n: because of lisp-1 that would require redefining eval, and then also compile, at least… so it wouldn’t be the same thing… common lisp just looks lower level
11:17:26
galex-713
I’ve also a friend who says continuation are terrible, in terms of general performance
11:17:50
jackdaniel
having some tool at your disposal does not mean that you have to use it, so it is not a problem that scheme has them
11:18:05
jackdaniel
one thing, which is not guaranteed by cl standard, but is guaranteed by scheme standard, is tail recursion
11:18:36
jackdaniel
otoh common lisp programs usually use iteration, not recursion (maybe because of that, but also iterative style is more plain imo)
11:18:55
galex-713
jackdaniel: to me it looks like a children toy, or a rounded knife for children, like it’s made so that you can cut yourself with it, which may be handy if you’re clumpsy, but you can do less with it
11:20:24
galex-713
jackdaniel: maybe iteration is also more culturally anchored… proper tail-recursion, if instead of reusing the name of current lambda function used something more akin to “return” but call “recurse” (or “repeat”) it would really look like a pascal/cobol/fortran (forgot which of those have that) “do … repeat”
11:20:26
sm2n
huh, I did not know that, I've never run into a stack overflow from writing tail recursive functions
11:20:59
jackdaniel
galex-713: continuations (and delimited continuations) are actually very cool concept, and the latter is quite practical and may be implemented efficiently
11:21:15
contrapunctus
Oh, speaking of recursion...is there a standard way or a library for named let in CL?
11:21:31
White_Flame
unless you can have 'repeat' in the middle of lexical bodies, and change a set of parameters inline with it
11:22:40
sm2n
though the latest iteration of continuation abstractions is effect handlers, which are quite cool and can be optimized away in certain cases
11:23:03
galex-713
White_Flame: well tco implies it’s somewhat near the end, so for variable binding/changing/conditions, I guess you can manage to do something which looks “almost the same”
11:23:47
galex-713
but to me it would then look uglier, and also it looks harder to modelize mathematically to prove stuff to me (but I’m not a math guy, many math stuff looks complicated too me, including formalizing behavior of an imperative loop)
11:24:23
contrapunctus
galex-713: I'm not sure you understand what I want...I'm asking, if I want to use named let for recursion, does the CL standard have that? Or maybe there's a library for it? (Of course I can write it myself with a macro, but I want to be aware of prior art.)
11:24:54
galex-713
White_Flame: yes but within do .. repeat you have some sort of return/continue (then it’s the same) or test guard right? you could use just the same stuff to define a variable “continue” which will affect that…
11:25:46
galex-713
though scheme appears to keep trying to reimplement all of cl, changing some names
11:26:01
ldb
sm2n: i mean, with out cps, a compiler can still implement effect handler, by embedding the right equational rules
11:26:23
galex-713
I know, but I don’t know how much the standard diverge, and it seems many people based on it for their implementation, at least at first
11:26:29
jackdaniel
galex-713: you may read the standard here: http://www.lispworks.com/documentation/HyperSpec/Front/index.htm
11:26:36
minion
galex-713: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
11:26:39
White_Flame
yeah, it took me a while to figure out what "named let" is, since CL LET obviously creates named bindings. LET is never anonymous
11:27:32
jackdaniel
it does not list changes from cltl2, but it has plenty of content which is not covered by cltl2
11:27:34
galex-713
jackdaniel: CLtL2 is a thousand page… reading all of it again is… well… especially for me it’s easier on paper, as I distract easily…
11:27:55
jackdaniel
http://web.archive.org/web/20130807175341/http://bc.tech.coop/cltl2-ansi.htm here you may see some comparison
11:28:39
ldb
sm2n: equational logic, an implementation is OBJ3 (written in CL) and its succesor Maude
11:28:40
galex-713
before buying CLtL2, I searched for a printed version of the standard, like hyperspec but paper, and didn’t find anything :c
11:29:22
contrapunctus
White_Flame: named let is Scheme's syntactic sugar for recursive functions - (let foo ((a 0) (b 1)) ... (foo 1 2) ...) (the next time, a and b will be bound to 1 and 2)
11:32:14
jackdaniel
galex-713: print this https://web.archive.org/web/20180811021738/http://cvberry.com/downloads/ansi_cl_standard_draft_nice.pdf
11:35:09
ldb
galex-713: there's a nice PDF version of CLtL2, under https://github.com/daly/axiom/blob/master/zips/clm.pdf
11:36:36
galex-713
ldb: I’ve the sources from steele’s website, as for CLtL2, I just can’t get the index to compile correctly
11:37:15
jackdaniel
I think that while cltl2 is nicely written, learning from it will do you no good, because it is a *different* language than Common Lisp
11:38:16
jackdaniel
it worked for me, cvberry.com website went blank some time ago, that's why I've linked the archive copy
11:38:50
easye
jackdaniel: RE: cltl2: slightly disagree, the style (Steele!) is excellent, and can help with some points. One does has to check the CLHS for exact differences, of course.
11:39:06
galex-713
ldb: I also have a compiled version with hyperlinks, but it’s more cool to have sources, to reprint and correct it if one day I feel it is needed
11:39:30
dra
galex-713: https://franz.com/support/documentation/cl-ansi-standard-draft-w-sidebar.pdf
11:41:09
galex-713
jackdaniel: I read the diff you gave, to me it looks small or superficial, I disagree, I hoped bigger change (like the series, CLOS or condition system added as annexes in second edition of CLtL… though I know CLOS description is not complete and doesn’t describe MOP, I didn’t find where to get anything about that, and thought I could complete with ANSI Common Lisp from Graham
11:42:04
jackdaniel
easye: it is a nice reading, but learning about cltl2 to understand common lisp is not a sound idea in my eyes, precisely because of these small differences
11:45:12
galex-713
I wished there were a fusion of CLtL2 and that draft, in some format such as texinfo, that could convert to both a readable TeX book and to an html hyperspec
11:46:43
galex-713
jackdaniel: I started with elisp, learnt scheme by reading r5rs, some r4,6,7rs and srfi, and wanted my knowledge to be exhaustive, I was especially excited about type declarations, but this doesn’t seem to have changed
11:48:30
galex-713
jackdaniel: dra: also, was cl only standardised by ANSI? wasn’t it also by ISO, IEEE, or something alike, outside of US?
11:49:37
ldb
galex-713: Anatomy of Lisp teaches the LISP family of languages via the formal semantics
11:51:01
jackdaniel
islisp has iso standard, eulisp was being standardized in Europe (but only drafts are available, it was never finished)
11:52:48
galex-713
anyway, I think if any foreign org should have done that, they should have just dubbed the ansi one