freenode/#lisp - IRC Chatlog
Search
3:44:22
White_Flame
well, specific to the comment I'm writing, "global value" would imply the value held in symbol's said "global binding", even if there are other dynamic bindings flying around
3:48:22
White_Flame
oh, and "global variable" is in the glossary as well: "global variable n. a dynamic variable or a constant variable."
6:14:29
smokeink
how to muffle such notes? note: doing unsigned word to integer coercion (cost 20) to "<return value>"
7:14:50
White_Flame
I have a macro that generates `(locally (declare ....) ,@body) so I can easily wrap it around small operations
7:15:43
White_Flame
(declare (sb-ext:unmuffle-conditions optimization-note)) around the parameters of the subform also allows its whinings to not be muffled, just the singular form in question
8:41:49
trittweiler
White_Flame, "global binding" versus "thread-local binding" (non-standard, of course) versus "local binding" is decent terminology I would reckon
8:44:48
jackdaniel
isn't the terminology: deep binding and shallow binding (and a symbol value which is not a binding)?
8:46:14
jackdaniel
and a consequence of deep binding implementation technique are thread-local bindings, and shallow gives you bindigns which are shared across threads (n.b probably harder to synchronize )
8:51:17
beach
jackdaniel: The distinction between deep and shallow binding is just an implementation issue.
8:52:34
beach
jackdaniel: Correct implementation of shallow binding in a multi-thread context is that there must be a per-thread "value cell".
8:54:06
beach
From memory, SBCL assigns a number to a symbol as soon as it is used as a variable. This number is used as an index into a table in the reified thread.
8:54:12
jackdaniel
hm, thanks for correcting me. I'll re-read the relevant parts of LiSP then to improve my understanding
9:07:35
jackdaniel
sorry, I can't tell from top of my head (and I'm focused on McCLIM issue atm so I'm not eager to look up ECL's internals code)
9:09:07
jackdaniel
I think that the location is on the stack and the array element is updated to point at that location
9:10:49
beach
But I wasn't asking what happens when a binding is done or undone. Just what SYMBOL-VALUE does. Again, if you are busy, you don't have to answer.
9:15:57
beach
For what it's worth, my current hypothesis is to use deep binding for SICL. I.e., the dynamic environment stack contains binding entries, and there is no per-thread table. SYMBOL-VALUE then has to search the stack to find the most recent binding.
9:16:50
beach
So searching for the current value or setting that value is more expensive than with shallow binding, at least if the stack is somewhat deep. Though finding the table in the thread is not free either.
9:17:30
beach
On the other hand, binding/unbinding is cheaper in deep binding than in shallow binding.
9:19:00
beach
If it turns out that 1. Access to special variables is frequent, and 2. Those accesses are often to deeply nested bindings, then I may have to reconsider.
9:28:19
White_Flame
beach: in SBCL, the TLS is always in a register, so "finding the table in the thread" actually is free
9:30:46
LdBeth
currying is just a function (defun currying (fn) (lambda (x) (lambda (y) (funcall fn x y))))
9:36:19
beach
It is *so* inspiring to answer questions from someone who 1. does not acknowledge this fact, and 2. leaves instead.
9:42:01
phoe
beach: the channel is logged, so if they ever come again and/or ask again, you can point them towards the logs in the channel topic.
9:43:18
jackdaniel
"- hey, I remember your nick from 5months ago, you did not thank me - do you remember that? - no (leaves the channel)", pretty burdensome strategy
9:44:04
jackdaniel
and I doubt that would change the culture of a person who is reminded that they did not follow proper netiquette
9:45:44
phoe
I thought of something like more like "oh I happen to recognize that nickname, they asked a question that was answered but they left, the answer is in the channel logs"
10:40:58
ghard
Have asked this before, methinks, but anyone tried to use ZS3 with DigitalOcean with success (claims to be S3-API-compatible) ?
11:04:13
no-defun-allowed
Note that it won't work for arrays of arbitrary dimensions, but only for one-dimensional vectors.
12:21:18
pjb
selwyn: (let ((array #2A((1 2 3) (4 5 6)))) (coerce (make-array (reduce (function *) (array-dimensions array)) :displaced-to array) 'list)) #| --> (1 2 3 4 5 6) |#
12:32:33
_death
pjb: just the other day I wrote this kind of flatten-array operator.. useful if you're representing bayesian network conditional probability as multi-dimensional arrays
13:07:28
reepca
for example: (defparameter test-array (make-array 10 :adjustable t :fill-pointer 0 :element-type '(unsigned-byte 8)))
13:07:51
reepca
(let ((*print-readbly* t)) (print test-array)) => #A((10) (UNSIGNED-BYTE 8) 0 0 0 0 0 0 0 0 0 0)
13:13:44
pjb
reepca: but you cannot use print, because it is not specified whether print uses print-object or not, and you cannot define print-object methods on standard classes such as array.
13:16:03
bitmapper
debugger invoked on a COMMON-LISP:UNDEFINED-FUNCTION in thread #<THREAD "main thread" RUNNING {10005084C3}>: The function SB-C::%MORE-ARG-CONTEXT is undefined.
13:19:11
boeg
I am trying to build a piece of software (the next browser) but it seems a common lisp error happens and it errors out. I get the error message thats put into the Makefile to make sure i have the xclip binary installed as well as developer files for sqlite and fixposix which I have in /usr/bin and in /usr/lib and /lib. I'm not sure if it's not able to find one or all of them or if something else goes wrong. Would anyone mind
13:19:11
boeg
look at the output from make and see if they can figure out what is wrong? It's here: http://ix.io/27sw
13:24:12
galdor
the error is The value "The root of all modes." is not of type LIST also called "do not use crappy stuff such as cl-annot which is dead, repo archived and unmaintained (and useless to start with)" or "test your code"
13:51:32
seok
if the complexity of gethash is O(1), isn't it better than arrays or lists in all cases for large dataset?
13:53:45
seok
phoe: so would that mean arrays are better in smaller sizes but hash better in larger ones?
13:54:09
Bike
you're not always using them for the same things, so comparing them may not be sensible
14:01:33
Nilby
Amortized O(1) + C is slower than exact O(1) + 0, especially when C is related to (length key).
14:15:04
pfdietz
Had a case recently where using string-case was much faster than intern, on a set of common symbol names.
14:15:06
pjb
seok: and here, you have integers as keys… Any other object would take a lot more time to hash.
14:15:55
pjb
pfdietz: you can usually exclude a case on 1 char=, and there are a finite number of cases, so you can select the right branch in basically O(1).
14:16:49
pfdietz
And you can play games with multiple character comparisons using (logior (logxor ...) (logxor ...) ...), which string-case does.
14:30:33
Nilby
Thinking about readably printing arrays made me try this experiement. Is there anything I missed? https://termbin.com/82c2
14:35:33
Bike
if you have two arrays displaced to the same array and you have print-circle you can reconstruct their sharing
14:36:33
_death
Bike: but then you want an actual displacement reference, rather than printing the data again
14:36:45
Bike
also if it is displaced you don't need the data. course you might have to recursively total-array-whatever-print the underlying array
14:42:34
_death
in reepca case it was also strange because he has an octet vector.. which usually don't have fill pointers, and usually are printed/read as octets..
14:46:03
reepca
fill pointer + adjustable was because there isn't a non-blocking way to read more than one byte at a time in usocket
14:50:37
_death
for adjustable, usually you know (or arrange to know) the size before-hand... for fill pointer, it makes sense, but for octet vectors I would consider having it separate so that you have a simple-array
14:51:28
boeg
How does it work when you have function with an argument list like `(defun aname (a (&rest argv) &body body) ()`? Doesn't &rest and &body kinda do the same?
14:53:15
Bike
it means it takes at least two arguments. the second argument is a list and fills argv, while any further arguments fill body.
14:56:45
p_l
I think it would look in use somewhat like (aname first-arg (argv list goes here) body...) ?
14:57:19
pjb
Nilby: note that if there's a displacement, you will want to have *print-circle* set to t, and deal with references.
15:01:25
pjb
Also, it looks like adjusting a displaced array to another displaced array so that there is a circle leads to an infinite loop.
15:05:03
pjb
Nilby: The problem is if you want to read back the printed-readably structure. If you just want to describe the structure, you can give all the information (a copy of it). But if you want to load back, you'd have to identify existing objects that are referenced. You get the ORM or OORM problem, with caching, identification of objects, etc…
15:21:57
pjb
Well, I'm not sure if it's completely specified. But basically, it assumes the current readtable. So if you print a symbol, you might not be able to read it in a different readtable, because it's not printed fully qualified and cased |FOO|:|BAR| would be the most readably. However, since again it depends on the readtable, it depends on the reader macro that could exist on #\|.
15:22:21
pjb
So something printed readably is not really stand alone. You must specify along the readtable.
15:26:40
_death
with-standard-io-syntax binds *package* and *readtable* .. though that wouldn't solve all issues of course
15:33:48
pfdietz
I would like to see similar tricks used for intern itself, at least for standardized packages or packages that import from them. Perhaps even dynamic code generation there.