freenode/#lisp - IRC Chatlog
Search
2:05:08
adlai
ACTION is estimating an ETA for ECL issue 305 fixing itself in the absence of external motivation
9:23:04
decent-username
I wanted to understand how :adjustable modifies the characteristics of an array. Therefore I've read what the HyperSpec had to say, but it didn't really help me. Why would I want to use ":adjustable t" when creating an array?
9:25:33
jackdaniel
decent-username: i.e when the average case is that array will hold 4 elements but in rare occasions it needs to hold 1024 elements
9:27:21
decent-username
Because doing something like (make-array 4 :adjustable t) will still raise an error when I try to use vector-push-extend
9:27:28
jackdaniel
if you have *a lot* of small arrays then it would be a huge waste to have each of them to have 1024 size
9:28:26
decent-username
ahh, I didn't know such a function existed. I think that's the thing that led to the confusion.
9:31:38
jackdaniel
I'm still waiting for the new CL standard with left-fill-pointer, rotating arrays and conformal displacement :-)
9:34:29
decent-username
the rotating part would allow for the creating of some interesting functions.
9:42:55
p_l
any language out there that has them in standard (not to be mistaken with abuse of communication primitives to make buffers
9:54:28
no-defun-allowed
phoe: depends on the circumference of the vector and width of the cells, assuming a spiral vector
9:56:44
no-defun-allowed
phoe: oh, you wanted circular vectors, and those were for circular vectors but I said spiral for some reason
9:58:56
loke
My circular array: https://github.com/lokedhs/containers/blob/master/src/blocking-queue.lisp#L17
10:01:24
no-defun-allowed
well, the vector is circular, the circumference is one-dimensional but the circle is two-dimensional
10:02:20
loke
no-defun-allowed: No. It's a one-dimensional vector. Just because its curvature is positive doesn't mean that there are any more dimensions.
10:07:13
loke
Some interating related discussion: https://www.physicsforums.com/threads/are-all-lines-one-dimensional.602170/
10:14:21
scymtym
decent-username: VECTOR-PUSH-EXTEND can adjust the array for you, but you have to specify both, :adjustable t and :fill-pointer VALID-INDEX-OR-T when creating the array for that to work
10:19:39
scymtym
loke: i don't follow. decent-username asked why (make-array 4 :adjustable t) followed by VECTOR-PUSH-EXTEND didn't work
10:50:53
montxero
Any ideas on how to deal with lambdas inside datastructures like a-lists? I am running into problems using those. Check https://pastebin.com/UP3i4YzP out
10:52:04
Shinmera
what you have there is not a function, but a list of (function (lambda ...)), since it's within a quote.
10:55:26
Shinmera
it's more consistent to not use #' for lambda, because there are cases where you must write (lambda ..) and not #'(lambda ..)
10:55:59
decent-username
Yeah, but why would you writem them though? (lambda ...) is more readable than #'(lambda ...).
10:57:25
loke
decent-username: (LAMBDA () ...) has a macro-expansion that expands it to (FUNCTION (LAMBDA () ...)). Now, #'(LAMBDA () ...) is a reader-macro that expands into... (FUNCTION (LAMBDA () ...))
10:59:14
Shinmera
A already knew I was right because the printed representation of a function is not readable, so it would show as #<function ..>
10:59:23
decent-username
loke: Is there a case where it matters if the macro is expanded during read-time compared to compile time?
11:03:10
montxero
decent-username: not to worry, we both learned someting new... or rather relearned
11:03:12
decent-username
alright, guess there's some stuff goin on under the hood that I don't know.
11:03:53
Shinmera
d4ryus: Generally no, but usually the quasiquote will have to create a fresh structure at runtime anyway.
11:07:38
d4ryus
Shinmera: hmm, interesting. Why/When would it need to create a fresh structure? It is creating a list at compile time, isnt it?
11:09:59
Shinmera
In fact, if it didn't, that would be catastrophic for macros, since a second invocation of a macro would suddenly change the results of a previous invocation.
11:11:00
decent-username
evaluating (setf blub (let ((xs '((a . #'(λ (s) s))))) (assoc 'a xs))) gives me something with the following printed representation (A FUNCTION (Λ (S) S))
11:11:01
loke
decent-username: You can intentionally create a pathological case where it does matter.
11:12:24
loke
decent-username: You can play around with EVAL-WHEN, and you can create all sorts of weird behaviour.
11:13:02
decent-username
Then make I'll sure to stay the fuck away from that evil satanistic function.
11:13:54
d4ryus
Shinmera: huh, thats new to me, i thought quasiquote was expanded at macro expansion time. But yeah, one can use quasiquote to do ,@ at runtime, neat
11:18:48
decent-username
LOL! I've configured emacs to show a literal lambda whenever I write "lambda" and that seems to mess with slime.
11:22:21
montxero
decent-username: huh? I have that setting and it works a treat. No issues with slime here
11:26:46
montxero
In the past, I ran into some problems with a similar function to what you have. I belive I got it from emacswiki
11:26:48
decent-username
maybe It interprets the character not as a unicode character but something else.