freenode/#lisp - IRC Chatlog
Search
12:33:42
aeth
verisimilitude: I wouldn't say that CL is more dynamic than Python. Common Lisp can be dynamic, and it can be not particularly dynamic, and really, quite the opposite of it if you hardcode everything in one giant macro that generates one function.
12:46:37
p_l
I'd say CL is less dynamic than Python, but that's related to obscure details of implementation in Python
12:47:06
p_l
you can program in similar style in CL, but it's very old and low-efficiency in terms of speed way
12:48:21
p_l
no-defun-allowed: funnily enough, RMS position is afaik not necessarily defended by GPL
13:37:02
MichaelRaskin
Hm. Can I submit a task in lparallel without creating a new anonymous function per task? Or what is recommended to use if I want to submit a lot of tasks with the same function and different arguments?
13:40:14
MichaelRaskin
Indeed; but submit-task definition refers to task-lambda which creates a new function via flet
13:42:03
_death
so you have an answer to your question ;) .. do you think it would be worth it to separate the context?
13:44:04
MichaelRaskin
I don't hae the answer to my complete question — what can I use for a thread pool without anonymous function per task
13:52:20
_death
lparallel also exposes a queue interface and implementations, but I don't recall them being too clever
13:57:21
Grue`
MichaelRaskin: you can have a bunch of workers per thread and each of them would grab args from queue and run your function in a loop
14:02:24
MichaelRaskin
Although maybe I am too pessimistic and my tasks (which write some files, and often spawn external programs) are not that cheap…
14:19:46
MichaelRaskin
I want the sum total of worker threads CPU share be larger than the main thread CPU share
14:40:07
White_Flame
the vast majority of allocations are just a pointer bump & range check, without even a function call
14:40:55
MichaelRaskin
Now I am trying to see if something can lock and force effectively single-threading operation
17:00:43
puchacz
what's the difference between handler-bind with binding for error as type vs t as type?
17:04:05
puchacz
and for "production", I think I should have t not error for graceful handling, i.e. showing the user "internal error" page rather than crashing sbcl, right?
17:05:22
puchacz
if I do not bind for something that is not an error but a different type of condition, will it crash sbcl?
17:07:43
puchacz
yeah, it sounds pejorative, I realise it is a reasonable behaviour, if I intentionally remove debugger, what else should it do rather than quitting?
17:07:59
jackdaniel
(timeout is not an error, still a serious-condition, same goes for out of memory conditions)
17:12:24
puchacz
and I quit it manually when it happens in dev computer, because I don't know how to use it :)
17:40:59
slaterr
I had a lot of fun writing a tiny html dsl in haskell. end result: https://bpaste.net/show/bad4ef1239ed
18:16:16
fiddlerwoaroof
But, since there's not really any way to recover once you enter it, it's never been very useful for me
18:16:58
fiddlerwoaroof
Now, if you could tell it to resize the dynamic space and continue, or something, it might be useful when you accidentally read in a huge file or something
18:35:14
drewc
ldb can be quite useful when trying to track down things that require it. For me, it was UCS-2 + Oracle + C + sockets + SBCL with the new UNICODE string encoding. That was the one time I have ever needed it, and it was quite literally tracking bits and bytes after crashes.
18:40:18
pjb
comborico1611: the repl can use any implementation strategy to evaluate the expressions.
18:41:02
comborico1611
I am able to LOAD the source code, but when trying to LOAD the compiled (fasl) file, I get an error.
18:52:43
comborico1611
Is there a special term for assigning a value to a global variable by calling a function whose lamda list contains that global value?
18:59:45
pjb
comborico1611: there's no difference between a parameter binding (lambda list) and a local variable binding in a LET, LET*, PROGV or PROG.
19:01:01
pjb
More precisely, there are other languages where the bindings are dynamic, but few of them. Mostly by accident.
19:02:34
pjb
But in most languages, there's no difference between a parameter and a local variable: even a input parameter (by-value), you can usually assign to it: int f(int a){ a=2; return a; } f(3) -> 2
19:09:58
Grue`
comborico1611: I'm not sure what "lambda list contains that global value" means. if you're passing the value to function changing it won't change the value of the global variable unless you mutate it
19:10:26
comborico1611
How would I access the individual add-list access functions? https://pastebin.com/9N8kNVXd
19:11:37
comborico1611
Grue`: Example: (defun bob (value *global-variable*) (BODY)) So calling (bob 2 'barker) would set global variable to barker.
19:12:28
pjb
comborico1611: in that cas, value is a normal lexical binding, as long as value is not a special variable.
19:12:59
pjb
comborico1611: but *global-variable*, assuming it's a special variable will be dynamically bound.
19:13:22
Grue`
comborico1611: it won't set *global-variable* to barker because it creates a new scope
19:21:53
pjb
A single symbol can be used to name a variable (multiple variables actually), zero, one or more functions, but also other things, such as types, classes, tags, slots, etc.
19:23:33
pjb
(mapcar 'funcall (flet ((foo () 1)) (cons (function foo) (flet ((foo () 2)) (cons (function foo) (flet ((foo () 3)) (list (function foo)))))))) #| --> (1 2 3) |#
19:24:03
pjb
There are really 3 different variables, and they have the same name. Only they are not accessible in the same scope.
19:25:55
pjb
(defclass foo () ((foo :initform 4))) (block foo (flet ((foo () 1)) (let ((foo 2)) (tagbody (go foo) hello foo (return-from foo (list (foo) foo (find-class 'foo) (slot-value (make-instance 'foo) 'foo))))))) #| --> (1 2 #<standard-class foo> 4) |#
19:26:21
pjb
There can be no overloading since foo is used to name different things, in different namespaces.
19:44:30
comborico1611
The main source of my current confusion is here. https://pastebin.com/hEJqdvXA
19:45:34
comborico1611
The author writes as if the accessor functions are implicitly defined from the subsequent creation of the structure.
19:49:21
buffergn0me
comborico1611: Indeed the accessors are defined by defstruct. How are you trying to run the code?
19:49:35
_death
you can see for yourself with (macroexpand-1 '(defstruct op action preconds add-list del-list))
19:59:04
comborico1611
Very annoying -- I don't know why I must retype type the quote marks. But for some reason, I must retype them. I was going to run the code directly from book. (I changed names of things for my understanding.)
19:59:58
comborico1611
buffergn0me: Here is the full program. But quotes are not registering correct on my Emacs. https://pastebin.com/qE19McPf
20:02:38
buffergn0me
comborico1611: Some program is "helpfully" replacing regular quotes with Unicode smart quotes
20:18:34
comborico1611
I got it to work! Now to figure out where things went wrong. Thanks everyone for help.
20:57:18
comborico1611
I believe the problem was I had the function definition too far down in code. I didn't realize that was an issue.
21:13:26
Josh_2
Parenscript is used to generate JS functions which can be written to files called .js files right?
21:17:06
buffergn0me
Josh_2: You can do that. Also generate the JS dynamically and serve it from a URI handler, or put it into inline <script> tags
21:17:55
Josh_2
buffergn0me: I have .html files that are handwritten instead of using a markup generator
21:19:13
Josh_2
I'll write my js with parenscript and output it to files then just manually include the names in my html files
22:00:53
pjb
buffergn0me: this is wrong, compile-file treats the file as a compilation unit. it uses with-compilation-unit! See
22:02:05
pjb
djeis[m]: it doesn't depend on the CL implementation. Any conforming CL implementation WILL HAVE to use with-compilation-unit (or the same effect) in compile-file, or it won't be a conforming implementation of ANSI CL!
22:08:25
buffergn0me
That's true, but what can you rely on WITH-COMPILATION-UNIT for? The only thing seems to be that forms are evaluated left to right
22:13:47
pjb
buffergn0me: it won't signals undefined function warnings when functions are defined after their use.
22:20:46
buffergn0me
Yeah, it definitely keeps things simple. There are a lot of things to be said about module systems that treat files/modules as units, simplicity and efficiency are not part of those things
22:31:50
pjb
I'm even more in the school: let emacs store the toplevel forms in the positions it determines itself by a topological sort.
22:48:09
pjb
That would free people of the burden of spreading their toplevel forms to several files, etc. This would be handled automatically.
22:49:40
verisimilitude
I find it stupid when a language forces files to be orthogonal with compilation units. Avoiding this is much more flexible, I think, and avoids the mess with largely superfluous files littered about.
22:53:24
buffergn0me
Well, you could have a compilation unit be a set of files in an ASDF definition