freenode/#lisp - IRC Chatlog
Search
9:09:25
dmiles
its: is_eq(X,Y):- X==Y , (\+ compound(X)-> true ; \+ \+ ((gensym(cookie,Cook),setarg(1,X,Cook),X==Y))).
9:12:12
Zhivago
So if you're making EQ more expensive than EQL, just have them share the same implementation.
9:13:13
Zhivago
You might consider something like is_eq(X, Y) :- object_identity(X) == object_identity(Y).
9:15:12
dmiles
of for 'objects' i use (objpointer 1111111111) == (objpointer 2222222) but for conses it walks over them
9:18:45
dmiles
symbols are interned objects so they end up with the same pointers (so good for me so far)
9:24:13
dmiles
(LIST (SETF my-point (make-point :x 3 :y 4 :z 12 ))(SETF my-point2 (make-point :x 3 :y 4 :z 12 ))) ==> (#<claz_u_point 10> #<claz_u_point 11> )
9:25:07
dmiles
*nod* .. in that case they are pointered.. i was hoping to not globally allocate simple vecotrs
9:30:28
dmiles
in a way i sorta got for free that beloved identity ;/ (that not sure i really wanted :P)
9:36:52
dmiles
horrible slow code " is_eq(X,Y):- X==Y , (\+ compound(X)-> true ; \+ \+ ((gensym(cookie,Cook),setarg(1,X,Cook),X==Y)))." compare datastrcuure value.. if they are the same poke a hole in one and see if they are still the same
9:42:25
loke
dmiles: It does, in the sense that a compliant CL implementation can return either NIL or T for that form.
9:47:10
loke
dmiles: No. EQ should return NIL if the objects are different. MAKE-WHATEVER creates a _new_ instance, so those two instances are distinctly different.
9:54:40
loke
dmiles: No. It's guaranteed to return NIL... The relevant quote from the Hyperspec: “subseq always allocates a new sequence for a result; it never shares storage with an old sequence.”
9:59:35
dmiles
ok soo... (eq #c(3 -4) #c(3 -4)) (eq #(3 -4) #(3 -4)) are undefined.. are their any others you can think of off hand?
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".