freenode/#lisp - IRC Chatlog
Search
8:03:02
seok
How is session managed in caveman2 when stored in memory, i.e, do I need to manage destruction to avoid overloading
8:30:30
faheem
aeth: I think if you want performance, portability would have to take a back seat. Though of course portability is desirable.
8:31:17
faheem
Documentation is a big problem, across the board. For much of the free software ecosystem.
8:31:49
faheem
It can be quite frustrating, having these powerful tools and not knowing how to use them.
12:17:56
jmercouris
hi guys, I am having a bit of a mental block here, let's say I have list like this (list 0 1 2 (my-fun 10)), how can I get the evaluated list where (my-fun 10) --> 10
12:22:03
ck_
maybe you want (mapcar (lambda (elt) (if (and (listp elt) (functionp (first elt))) (apply 'funcall elt) elt)) list)
12:23:19
jmercouris
however I want to store the unevaluated, aka quoted from of the list, and then the evaluated form of the list
12:24:29
jmercouris
I want to store the unevaluated form as well because if I change some of the functions, I would like the new output
12:41:46
pjb
(defun my-fun (x) 10) (let ((have-list '(list 0 1 2 (my-fun 10)))) (eval (first (last have-list)))) #| --> 10 |#
12:43:31
pjb
jmercouris: on the other hand, if you want to save both the unevaluated form and the evaluated form, perhaps eval is what you want. Unless you need access to the lexical environment, in which case a macro might be preferable.
12:45:54
pjb
(defmacro save-form-and-value (form stream) (let ((value (gensym)) (vstream (gensym))) `(let ((,value ,form) (,vstream ,stream)) (print ',form ,stream) (print ,value ,stream)))) (save-form-and-value (+ 1 2) *standard-output*) #| (+ 1 2) 3 --> 3 |#
12:46:38
pjb
jmercouris: have a look at DRIBBLE (some implementations write both the form and the values).
13:12:35
beach
Also, you can't be sure that people here know Java, so you need to explain what it is you want to do.
13:19:01
beach
bzp: If you want to learn Common Lisp, people here are more than willing to help, but it doesn't look like you do, so I am guessing it is unlikely that you will find someone to do this for you here.
13:19:23
ck_
bzp: I tried! Unfortunately, I failed at the first line :-( I don't know how to import java.util.* in Common Lisp
13:21:28
_death
here you go: (let ((a (make-array (list (read) (read))))) (map-into (make-array (reduce #'* (array-dimensions a)) :displaced-to a) #'read) (print a)) ;; HTH
13:28:53
ck_
bzp: okay -- you said you tried your hand at implementing it in common lisp. Can you show that code, please?
13:59:10
minion
bzp: please 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).
19:35:49
shka_
is it possible in asdf to ask to compile every file in the project as one compilation unit?
19:40:02
p_l
don't recall such function, but it could be possible to write something that makes it happen? a new kind of file which is interpreted to be concatenated from several others...
19:40:27
p_l
there's a problem that the only way to force single compilation unit iirc is to make it a single CL:COMPILE input
19:46:42
shka_
p_l: i don't think that this is true, standard explicitly states that compile-file works by wrapping input in with-compilation-unit (:override nil)
19:47:07
shka_
therefore, it should be possible to compile-file in loop while in with-compilation-unit
19:48:17
p_l
shka_: still, you will probably need to either modify existing ASDF compile-op, or implement your own as different file-type and inside of it call compile including with-compilation-unit
19:56:26
p_l
very interesting. I thought of various extensions one can use to implement their own compile-op, but I see there's some arguments already...