freenode/#lisp - IRC Chatlog
Search
16:09:52
hectorhonn
but, one of the element, is an integer, which i want to convert to a date string
16:10:37
pfdietz
Converting an integer to a date string is a problem orthogonal to where that integer came from.
16:13:10
beach
hectorhonn: But, these are questions that are a bit to basic for #lisp. I suggest you ask them in #clschool instead.
16:14:03
pfdietz
(let ((x (list 1 2 3))) (let ((y (elt x 1))) (setf y 10) x)) ==> (1 2 3), not (10 2 3)
16:15:54
pfdietz
Often when these questions get asked, the hard part is figuring out what led to the question, not answering the question itself.
16:25:39
hectorhonn
(defun ff (list position function) (append (subseq list 0 position) (funcall function) (nth list position) (subseq list (1+ position))))
16:28:37
beach
Here is another (defun ff (list position function) (loop for element in list for i from 1 collect (if (= i position) (funcall function element) element)))
16:28:40
hectorhonn
hmm it says, ; Derived type of LIST is (VALUES SEQUENCE &OPTIONAL), conflicting with its asserted type UNSIGNED-BYTE.
16:29:06
pfdietz
The best solution, though, is seeing if one of the de facto standard libraries has a function that does what you want, and using that.
16:30:47
beach
hectorhonn: I don't usually write code using IRC, so I don't have the usual help from SLIME and the Common Lisp implementation.
16:37:47
hectorhonn
(defun ff (list position function) (append (subseq list 0 position) (list (funcall function (nth position list))) (subseq list (1+ position))))
16:39:48
hectorhonn
pfdietz: i looked in the CL quick reference but didn't find any.. might have missed it
18:03:10
jackdaniel
beach: this excerpt addresses this question: "the metaclass is changed from the standard generic function metaclass which in turn prevents certain optimizations, of the dynamic generic function dispatch, from being performed by the compiler." (part of comparison with inlined-generic-funcitons
18:07:20
pfdietz
This suggests that gf metaclasses need additional infrastructure to support these optimizations (perhaps in an implementation-dependent way).
19:18:33
jasom
fouric: late now I know, but the following should find symlink loops: find . -follow -printf ""
20:13:46
Younder
I say this in remembrance of Vladimir Voevodsky a brilliant mathematician who died before his time. This is his legacy.
20:15:53
Younder
Homtopy type theory, the univalent theorem and a program at Princeton Institute of Advanced Study for continuing it.
21:20:57
no-defun-allowed
Not in the standard but lparallel and Bordeaux threads are good starting points.
21:21:56
figurelisp
so when common lisp was popular people used these kind of libraries to handle concurrency?
21:24:37
no-defun-allowed
Well, probably not before the AI winter, concurrent machines probably had non-generic designs since those were expensive and new.
21:26:39
pfdietz
There's a common model of concurrency in CLs now, where special variables dynamically bound in a thread are thread local.
21:27:32
pfdietz
And I think there's de facto compatibility of the various thread primitives, at least through a compatibility layer?
21:33:10
figurelisp
I am still in my very early lisp phases. It was just that this question popped in my head
4:05:20
Bike
depends on implementation. the obvious is n², but i think some implementations use hash tables and stuff to reduce it