freenode/#lisp - IRC Chatlog
Search
21:49:23
aeth
You can still define a deep copy by renaming the copy function to %copy-foo and defining an inline copy-foo that does a deep copy
21:50:27
aeth
didi: The standard-object (not CLOS object) way to do it would be to define a copy generic
21:50:34
didi
aeth: But shallow copies can be useful. I'm using it right now. I want a struct just like the original, but with only one slot changed.
21:51:13
aeth
I'm not sure why there isn't a copy method that defaults to a shallow copy for defclass
21:52:13
aeth
jasom: Well, the main point in modern CL is that structs can be optimized for storage and access if :type is provided for a slot
21:55:51
aeth
Except for multiple-value-list and multiple-value-call, if you request the nth value and it doesn't exist, you get NIL as the default value
22:00:12
jasom
the thing I like about the random version is that it is only probabalistically defined to terminate from the standard, but most (all?) real-world implementations it is guaranteed to terminate.
22:02:02
jasom
Bike: if a non-cyclic rng is used, then the probability approaches 1 of it terminating over time, but never reaches it. Real prngs tend to be cyclic though, so there is bounded time for it to terminate (even if it's absurdly large).
22:03:24
Bike
"A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number." uh
22:04:11
Bike
most-positive-fixnum is finite, and since it's an integer the distribution is discrete
22:05:20
jasom
Bike: consider flipping a fair coin. Let's say I flip the coin until I get 5 heads in a row. That is not guaranteed to terminate, though it is very likely to for any large number of iterations.
22:06:20
jasom
similarly an implementation with less than (integer-length most-positive-fixnum) state in its prng might never terminate on that.
22:07:02
jasom
and it's guaranteed that there are some values it will never return from (random most-positive-fixnum) if there are that few bits of state in the prng.
22:07:55
Shinmera
jasom: Though the spec does say: If limit is an integer, each of the possible results occurs with (approximate) probability 1/limit.
22:08:44
jasom
Shinmera: no finite state prng can do this when you consider bignums, unless you think the spec implies the state must be larger than the largest allowed bignum.
22:09:28
jasom
Shinmera: if it required each possible result to occure with identical probability, then it would explicitly not allow holes.
22:10:37
jasom
Shinmera: there are lots of imperfect prng with 100% even distribution of values (a simple LCG does this, for example).
22:28:20
adlai
re: "most interesting way to get the value NIL" ... how about "as return value of #'type-of"
0:04:31
aeth
Has anyone seen pillton? I just did a `tail -n 100000 '#lisp.log' | grep '\(pillton\)\|\(Day\)'` and it looks like he was last here 21 August
0:10:44
aeth
I'm recompiling with my cache clear to verify it but I think I get problems with specialization-store and ECL and I always try to verify things like that over IRC first.
0:12:16
Colleen
Bike: drmeister said 36 minutes, 42 seconds ago: (ql:quickload something :verbose t) provides lots of info - thank you.
0:18:04
aeth
Hmm, yeah, in ECL I get "* The macro form (VEC--INTO! TEMP-VECTOR-1 VEC2 VEC1) was not expanded successfully."
0:22:42
Jachy
minion: memo for nixfreak: https://github.com/t-sin/one (example of using CL with bash one liners)
5:15:39
nyingen_
So there's a CL lib on github I forked and made a minor patch to (to make it work in modern times). Last commit was 7 years ago. Should I still file an issue and/or make a PR?
5:31:21
jackdaniel
nyingen_: one reason you should do that is a possibility, that someone takes a burden of maintaining this library in the future (not the original author). place he'll take the code and issues is the original repository, same goes for accepting pull requests
5:32:10
jackdaniel
fwiw that's one of things we did with log4cl: we've retyped issues from the original repository and merged dangling pull requests
6:53:15
beach
If you think you are dealing with decimals, you will be very confused when you try (+ 0.3 0.6)
6:54:05
no-defun-allowed
my personal favourite is 0.1 + 0.2 but i think it's double floats only or something
6:54:26
beach
A large proportion of my students told me that SBCL had a bug, the first time they saw this behavior. Very interesting that they had never noticed it in any other language.
6:55:14
lieven
what every computer scientist should know about floating point still isn't read widely enough :)
6:55:40
no-defun-allowed
beach: if you're not busy, could you please explain how SICL manages finding the GC roots in a program?
6:55:44
asarch
Well, I helped my younger brother to add fractions with just pen and paper and I couldn't find in my notes the way to get '0.5' :-(
6:56:32
no-defun-allowed
sbcl uses a conservative approach on x86 and x86_64 but i was wondering if you used specific registers or anything to distinguish unboxed and boxed values
6:57:07
beach
no-defun-allowed: Well, the SICL GC has not been entirely implemented yet, but here is the plan...
6:57:35
beach
no-defun-allowed: For each value of the program counter, the compiler emits information about what is contained in which register.
6:58:32
no-defun-allowed
so the GC just looks up the program counter in your table and looks at what types exist in the registers?
7:00:26
beach
Anyway, you have the complete description in that document. As I wrote, the thing is complicated by callee-saves registers.