freenode/#lisp - IRC Chatlog
Search
10:02:30
pjb
dmiles: the reason why (eq "Foo" "Foo") and(eq #(3 -4) #(3 -4)) are undefined, is because "Foo" and #(3 -4) are literal objects, and when file-compiling, they may be coalesced to the same object (and put in read-only memory).
10:03:23
pjb
(eq (make-string 3 :initial-element #\F) (make-string 3 :initial-element #\F)) --> NIL is defined.
10:04:52
pjb
(eq '#.(make-string 3 :initial-element #\F) '#.(make-string 3 :initial-element #\F)) is not defined, because both strings "FFF" created at read-time (they're not EQ, there are two of them), but they are both compiled as literal objects because of the quote, and file-compile can coalese them to a single and same string "FFF".
10:05:11
pjb
basically: before file-compile it would return NIL, after file-compile it can return T.
10:07:31
pjb
dmiles: in a first version, you could take all the shortcuts allowed by CL… (defun eq (x y) (eql x y)) (defun delete (…) (remove …)) ; etc.
10:13:29
dmiles
ha lordy i just found http://www.swi-prolog.org/pldoc/doc_for?object=same_term/2 slightly cheaper than " is_eq(X,Y):- X==Y , (\+ compound(X)-> true ; \+ \+ ((gensym(cookie,Cook),setarg(1,X,Cook),X==Y)))." but i swear that was there a year ago
15:09:44
Success
sorry for the repost but i really don't know what i'm doing. how do i get the gdp per capita out of this? https://gist.github.com/Announcement/3adb64d1742ab69aa78e4e0dc5553369
15:17:36
beach
Success: Your question is hard to answer because you haven't told us what operations are allowed. I mean, I could give you a bunch of CARs and CDRs that together will access the correct data, but you can probably do that yourself.
15:18:30
beach
Success: I am also wondering whether ($ $) and (. .) indicate that some information was not printed.
15:19:20
beach
Success: How can you be doing Common Lisp if you don't even know what CAR and CDR do?
15:21:49
beach
Then just take either the CAR or the CDR of the expression, and if the information is in the result, you chose the right operation.
15:37:07
devon
latest QL in latest CCL on MacOS 10.11 bombs compiling gsll-quicklisp-dd2e7673-git/init/init.lisp
15:43:54
devon
Probably lacking some binary or library, eof reading some string, probably output of some attempt to run some program. No biggie, just wanted a 1st order histogram of some really strange data out of curiosity.
15:54:03
Josh_2
You can clone it from git and then add it to local projects in your quicklisp install folder, then it should work
16:35:54
devon
Any other ways to do (let ((count 5)) (format t "~v,,,'*A~%" count "") (princ (make-string count :initial-element #\*)))
16:42:01
dwts
jackdaniel: it's clear that C's version offered an improvement. I'm not experienced enough to decide if "importing" it to lisp is an improvement but the example looks quite similar
20:01:37
jackdaniel
smurfrobot: sbcl is a cmucl fork. sbcl goals were to clean up bootstrapping process and some internals as well as to get rid of some contribs
20:02:10
jackdaniel
sbcl is more popular and has more developers, yet cmucl is still developed as well
20:03:11
jackdaniel
sbcl compiler comes from python (cmucl compiler). if you want to compare how similar they are I advise to examine source code. they are probably different in details but still similar in general design (just guessing)
20:04:13
jackdaniel
if you are interested in relation between various common lisp compilers, check out this graph I've made: https://twitter.com/dk_jackdaniel/status/698157022483771392
20:04:47
jackdaniel
whoman: python is a name of the cmucl compiler. it's not the same thing as python the programming language
20:05:29
jackdaniel
smurfrobot: other implementations channels on freenode I'm aware of: #ecl, #ccl, #clasp, #abcl
20:06:49
jackdaniel
(some information about python: https://www.common-lisp.net/project/cmucl/doc/cmu-user/compiler.html)
20:18:37
jackdaniel
thanks, it got updated slightly (I've got it somewhere in ECL website resources) but I didn't bother to look for it
20:20:14
jackdaniel
https://common-lisp.net/project/ecl/static/quarterly/img/vol4/all-hierarchy.png here
20:20:22
koenig
Are you the developer (a developer) of ECL? I've never been able to completely understand your relationship to ECL just from channel context.
20:21:29
White_Flame
and things like TI explorer and Genera have non-CL shared heritage, which might be nice to include
20:21:36
jackdaniel
White_Flame: another idea was to put pre-CL predecessors - I had no idea how to fit it nicely
20:22:01
koenig
Thanks for your work on ECL, then. I have enjoyed using it in a couple different places. I have a hare-brained idea of making ECL into a WeeChat plugin "when I have some free time".
20:49:37
whoman
one of us was using ECL to enhance one of the Quake 3 engines, too. may have been aeth
20:50:34
Somelauw
I'm actually interested in emacs-lisp, but since clos is more of a common lisp thing, I'll ask here. How to make private variables and methods and how to modify the constructor?
20:50:36
jackdaniel
have it got enhanced? I bet his missle bazooka stopped aiming correctly because of that ;-)
20:51:22
jackdaniel
Somelauw: you don't make them private. You may skip providing accessor for them, or name it %foo (% means, that operator is internal)
20:51:42
jackdaniel
regarding constructor, you may define method initialize-instance specialized on your class
20:52:54
jackdaniel
if you really want to make it private, you could use uninterned symbols for slots I suppose, but that would be awkward and requires some work to add ways to access the slot
20:53:20
Somelauw
jackdaniel: so for variables, the style is to user get-attribute, set-attribute - never slot-value? What about private methods?
20:53:27
nyef
... And doesn't actually stop someone with a metaobject protocol from going in and opening things up anyway.
20:55:13
Somelauw
ah, so in common lisp you explicitly export get/set/accesor methods to make them public?
20:57:09
jackdaniel
if it is internal, then accessing it requries extra double colon like package::foo (while exported symbol may be accessed like package:bar)
20:58:55
jackdaniel
namespaces and packages are different things. I think you should do some research on your own about common lisp package system
20:59:51
jackdaniel
right, if you are interested in the topic, it might be worth reading about it on published resources
20:59:55
minion
Somelauw: have a 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).
21:00:30
uint
I just want to note :: should be generally avoided since it's for accessing internals of a package from outside of it
21:02:26
jackdaniel
Somelauw: fact that this book is still actual proves, how solid common lisp standard is ;-) no go and read some, it is a perfect resource to learn about programming in CL
21:02:27
uint
: is for accessing the interface (exported symbols) of a package, :: is for accessing any symbols within the package
21:03:05
mfiano
whoman: if you're inside a package and want to access its symbols, you don't need any package qualifier, single or double colon.
21:05:54
smurfrobot
I guess maybe i should read the cmucl compiler code b4 the sbcl it seems to have clearer comments. there is a lot of stuff in the sbcl that are FIXME type comments.
21:06:14
Somelauw
i seem to have already read some chapters of that book, by googling(duckduckgo) "common lisp ...", but never in full and didn't even realise it
21:08:12
Xach
smurfrobot: it has a peculiar idea about the worthwhile parts of CL. and it gets the performance model wrong.
21:09:35
smurfrobot
practical common lisp looks pretty good from what i have read might buy a tree copy.
21:12:57
Somelauw
I have secretely learned a lot about "scheme", "emacs-lisp" and "clojure" instead of common lisp.
21:13:35
Younder
For the more advanced reader Eddi Weitz book Common Lisp recipes is a good reference work.
21:16:20
Younder
ML is a bit old, most people today use OCAML. It a purer functional programming language than Lisp which is more multi paradigm.
21:18:39
smurfrobot
how different is ocaml from ml? my understanding is the type system isn't quite the same.
21:21:30
mfiano
It looks like the printing press is 2 hours from me, so I just received my Cyber Monday PCL and CLR books I ordered. Best $25 I probably ever spent - $105 saved.
21:28:20
mfiano
Common Lisp Recipes. All Apress books _were_ $12.50usd from Friday until yesterday. Deal's over.
21:28:22
jackdaniel
common lisp recipes, new book written by Edmund Weitz (very good one, I have it on my shelf)
21:46:40
jmercouris
I've read a little bit, but it's not clear to me what purpose they serve? to implement an algol like language on top of lisp?
21:47:48
Shinmera
Early on it was believed that an M-expression syntax would be more "natural" and generally better than s-expressions.
21:49:57
Xach
jmercouris: http://www-formal.stanford.edu/jmc/recursive.pdf explains them. (that is the original lisp paper)
21:51:06
jmercouris
From first glance this a surprisingly easy to read paper, I guess they had to explain literally everything as there was no background knowledge about programming tht one could assume back then
21:59:23
jmercouris
Any bindings/libs that utilize CFFI are essentially just convenience wrappers to make something easier to use in CL, or is my understanding incorrect? e.g. something like this: https://github.com/crategus/cl-cffi-gtk is using CFFI to make a more lisp friendly interface to GTK
22:00:14
jmercouris
Someone wrote the bindings right? So you should be able to write your own bindings theoretically
22:00:32
jmercouris
cl-cffi-gtk does not actually implement CFFI, so anything possible in cl-cffi-gtk should be possible using just CFFI right?