freenode/#lisp - IRC Chatlog
Search
18:52:01
whaack
so (cddr '("this" . "that")) is going to error while (cddr '("this" "that")) will not
18:55:01
jmercouris
Reccomendations for cl json type lib? I've been personally looking at cl-json (https://github.com/hankhero/cl-json)
18:57:57
jmercouris
Shinmera: Alright, cl-json it is! Seems like my use case is already described in that article. Thanks for the link!
19:02:48
jmercouris
Does there exist an article someone can reccomend that compares and contrasts different common lisp graphical toolkits and bindings? E.g. why might someone choose mcclim over gtk etc
19:36:03
whaack
i'm not trying to append per say i'm trying to pull out the list one level, like loop through and append
19:36:33
pjb
(mapcan (function second) (copy-tree '('(a b c) '(d e f) '(g (h i))))) #| --> (a b c d e f g (h i)) |#
19:37:02
pjb
whaack: Please, go read: Common Lisp: A Gentle Introduction to Symbolic Computation http://www.cs.cmu.edu/~dst/LispBook/ http://www-cgi.cs.cmu.edu/afs/cs.cmu.edu/user/dst/www/LispBook/index.html
19:50:27
aeth
In case anyone's wondering, mapl is similar to mapcan if you want to mess with side effects directly instead of using the automatic nconc.
19:52:14
Bicyclidine
it returns the first list you passed to it. not that this matters to the point.
19:53:35
Bicyclidine
docstrings on sbcl are kind of haphazard, for functions you can just look up in the clhs.
19:54:02
aeth
I use mapl like map nil if I need to look ahead because I can e.g. do something to the car of x unless the cdr of x is endp and otherwise treat it like map nil (except with the restriction that I have to be taking the car, of course)
19:54:33
aeth
I was going off of memory of the docstring that I looked up when I was on my laptop in an area without Internet
20:13:43
drmeister
Then I googled the right word combination and I think ECL doesn't have .fasl extensions. .fasb is a native fasl and .fasc is a portable fasl.
20:14:32
drmeister
I'm working on mimicking the C:BUILDER function in ECL and my version is being called with a .fasb extension and I'm not sure where it's coming from.
20:18:06
scymtym
aeth: documentation strings of CL:MAP* functions were improved recently. it says "... Return LIST." now
20:27:24
dmiles
i mean in that wouldnt implementor end up making a Meta Object Protocol when they are implementing CLOS?
20:32:00
pjb
But if you were to write CLOS in C++, you could very well write it without providing a MOP.
20:34:57
Bicyclidine
like, standardly speaking, standard-class is a standard-class, that's "meta". but there's nothing about compute-effective-method or make-method-lambda.
20:36:59
dmiles
is it anything more than just that ? = reflective exploration and definitions to CLOS
20:37:43
pjb
Well it would allow user code to define their own object system! With their own implementation choices. So it can be quite sophisticated.
20:42:06
drmeister
Shinmera: I was able to get asdf:monolithic-compile-bundle-op to work with Clasp.
20:42:44
drmeister
I had to write some code to get Clasp to fully mimic ECL's C::BUILDER function - which is invoked by ASDF.
20:44:22
drmeister
So - just to recap - this is what people do when they want to bundle up a bunch of ASDF systems into a single fasl file and load them all at once.
20:45:38
Bicyclidine
like, the MOP is a particular protocol (though it's not as solidly defined as CL itself). it's not the only way to have reflection in CLOS.
20:47:52
dmiles
it feels liek (i am probably wrong) that if one Common Lisp the Language, 2nd Edition .. they've walked into MOP?
20:49:00
dmiles
why i think/thought that is.. https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node284.html
20:52:01
dmiles
Oh "The Common Lisp Object System (CLOS) is an object-oriented extension to Common Lisp. It is based on generic functions, multiple inheritance, declarative method combination, and a meta-object protocol."
20:53:41
dmiles
ACTION got first quote from https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node261.html
20:54:35
Shinmera
Ober: https://www.youtube.com/playlist?list=PLkDl6Irujx9MtJPRRP5KBH40SGCenztPW https://www.youtube.com/playlist?list=PLkDl6Irujx9Mh3BWdBmt4JtIrwYgihTWp
20:56:48
dmiles
oh "The third part, The Common Lisp Object System Meta-Object Protocol, explains how the Common Lisp Object System can be customized. [The third part has not yet been approved by X3J13 for inclusion in the forthcoming Common Lisp standard "
20:57:47
dmiles
in other words one can claim to have implemented common lisp dispite missing that third part
21:01:39
Xach
Common Lisp: The Language is an interim document with an interesting history but not fully reliable as a reference
21:02:57
dmiles
so if one really implments all of what is there .. such as http://www.lispworks.com/documentation/HyperSpec/Body/m_defi_4.htm#define-method-combination
21:08:43
Xach
dmiles: the MOP is not part of the formal standard, but each implementation has its own MOP and there are generally few differences between them
21:13:48
Bicyclidine
you can have define-method-combination without having a compute-effective-method that takes the same arguments, or that is a generic function.
21:13:49
dmiles
i think (cant tell for sure) is that CLOSER-MOP has its own package that wraps each impl?
21:14:53
dmiles
(ok good, the reason i asked is it could ahve created an *altranate protocol* that wraps each)
21:22:40
dmiles
ACTION secretly wishes it was *under* standard-object instead or at the same level as condition
21:23:31
dmiles
i think i was asking this last night.. buit not sure if i understand if it was a bad idea
21:26:30
dmiles
right now is have something called a "slotted-class" which both standard-object and structure-object is
21:28:39
Bicyclidine
it might be standard-conforming to have one be a subclass of the other, alternately, but it doesn't seem like a good idea to me. they have some pretty distinct behaviors.
21:38:59
dmiles
ACTION was *hoping* that a shared-initialize would be synthesized like :include superclass
21:44:35
dmiles
if a user defines methods on shared-initialize i would assume that those would need defined before #S( ) (calls make-instance) is read
21:45:57
jackdaniel
drmeister: natively compiled files have extension fas, bytecode compiled files have extension fasc, multiple systems compiled and bundled together into single file have extension fasb
21:47:42
jackdaniel
if you are interested in builder overview, here is some documentation on it: https://common-lisp.net/project/ecl/static/ecldoc/Extensions.html#Compiling-with-ECL
21:49:06
drmeister
Thank you - I saw that and it didn't jive with my (incorrect) recollection that ECL also had a .fasl extension.
21:49:50
drmeister
I added a BUILDER function to Clasp that ASDF invokes and now Clasp builds .fasb libraries as well.
21:50:13
jackdaniel
"fasl file" label relates to the full name (fast load) as it is commonly named, not to extension
22:34:24
florin96
Hello. Does anyone know why do I get "line 6 should be lambda" on this small code? https://paste.ofcode.org/FtHhckzjyp2Sj8FasszuiM
22:39:31
pjb
florin96: also, it may help to use different CL implementations, some may provide better error messages than others…
22:40:39
pjb
florin96: what implementation do you use? I know no CL implementation reporting errors by line number.
22:42:11
pjb
Common Lisp is a language, not an implementation. Languages don't signal errors. Implementations do!
22:45:52
pjb
my clisp says: SYSTEM::%EXPAND-FORM: (LOOP (IF (= 1 (LENGTH L)) (RETURN T) (IF (> (FIRST L) (SECOND L) (RETURN NIL))) (REMOVE 0 L))) should be a lambda expression
22:55:07
k-stz
hey im having trouble using (cffi:foreign-array-to-lisp <pointer> <array-type>), I can't figure out in what way to pass the 'array-type' argument. I have an array of :unsigned-char's with 1000 elements
22:55:15
pjb
florin96: how can you do advanced functionnal programming in lisp when you don't even know the basic syntax of lisp?
22:56:07
pjb
k-stz: I would try '(cffi:array :unsigned-char 1000) and if that doesn't work, I would read the user manual.
22:58:32
pjb
florin96: you should read chapter and chapter 3 of clhs. in particular: http://www.lispworks.com/documentation/HyperSpec/Body/03_aba.htm
0:22:25
k-stz
So I was asking recently for a portable way to translate foreign c-arrays to lisp arrays for efficiency, and it ends up that there is no difference for scanning over either of those (the lisp-array was even slightly slower)
0:25:47
pjb
Because he thought he could take advanced functional programming in lisp, before learning the basic lisp syntax.
0:30:00
aeth
Very basic Lisp syntax: foo(x, y) becomes (foo x y) and foo[0] becomes (elt foo 0) and foo["key"] becomes (gethash :foo key) and foo = bar becomes (setf foo bar) and [1, 2, 3] becomes '(1 2 3) or (list 1 2 3) or #(1 2 3) or (vector 1 2 3) depending on if you want a linked-list (sequential access) or a vector (O(1) access to any elt)
0:31:02
aeth
Even with just that, the mistake becomes clear, the ((loop ...)) is a function call (it only wouldn't be in a special form like let)
0:31:46
aeth
you're right, I kinda rushed that, I should just have it written right once and then paste it in whenever basic syntax errors come up
0:45:01
k-stz
im struggling with the ending bit, and getting distracted by efficiency issues, but it won't be long now
4:03:13
Ober
is there some case issue with allegro not finding a function name in this fashion ? (defun star-call () (funcall (find-symbol (format nil "~a-call" *my-type*))))
4:06:32
pjb
Ober: ~A depends on *print-case* and other variables: DO NOT use it to build symbol names!
4:08:41
pjb
Ober: also, this is not conforming code (funcall (find-symbol because implementations are allowed to FBIND any symbol from CL, including CL:NIL, which can be returned by find-symbol.
5:13:47
Ober
(defun star-call () (funcall (find-symbol (string-upcase (concatenate 'string *my-type* "-CALL"))))) ;; more respectable? or string-upcase unsafe in this context? I will be testing if find-symbol returns nil or not. just trying it out in the repl. refactoring a lot of rundundant code