freenode/#lisp - IRC Chatlog
Search
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
22:53:41
pjb
well, files are stupid to store code. They're good on a unix system, but interlisp allowed image-based development, and other ways to store the sources could be useful, with nice tools to query and navigate the source. For example, since we have multiple dispatch methods, we may want to see all the method dispatching on class A, and then all method dispatching on class B, then a (defmethod moo ((a a) (b b)) …) would appear in
22:53:43
_death
I have a catjava utility to concatenate all java files.. then I use a hide-comments function.. then I can read the code :)
22:54:50
aeth
I disagree. With files, you have a known working state you can inspect completely. With images, well, let's just say I use M-x s-r-i-lisp a lot.
22:55:45
aeth
Sure, you could have a presentation layer on top of files that selects e.g. all of the method source code.
22:56:39
Xach
akater: quicklisp-slime-helper is a way to get slime without much other setup. it is guaranteed to be synced with the quicklisp swank version. if you have another way to get and init slime, there is no advantage. it's pretty handy on a "cold" system in my experience. it predates emacs packages being very convenient.
22:57:11
pjb
Having a static "script" to reproduce a similar image is god, but it doesn't imply using files. The source can be stored in a database or otherwise.
22:57:23
aeth
pjb: But I don't want to think database instead of file. The files are essentially scripts that create a reproducable working state
22:57:26
verisimilitude
You could have image-based development with CL if implementations had FUNCTION-LAMBDA-EXPRESSION work well every time.
22:58:15
pjb
aeth: they're a simple solution granted. But again, newbies and a lot of people seem to have problem organizing themselves, so if it can be automatized, soon you can see that you can use other storage systems.
22:59:03
verisimilitude
Modern file systems don't even have versioning, as they lost it, so it's bad all-around.
22:59:29
aeth
pjb: The problem is tools. It doesn't take much to go from M-. (which will always work and take you to the first line, except for some rare C-c C-c cases) and paredit etc. to being able to create new "files" of every defmethod foo
23:04:15
aeth
verisimilitude: file systems don't have versioning but we have the 80% solution of git, which we can use for all of the important text files
23:04:43
buffergn0me
gilberth: That is what WGREP-CHANGE-TO-WGREP-MODE does in GNU Emacs grep buffers. Essentially displays and edits subsets of multiple files in one buffer
23:04:47
verisimilitude
We have git, an ugly, manual, explicit, and worse implementation of part of a real file versioning system, yes.
23:05:17
aeth
verisimilitude: Every file being versioned would have to solve more problems, like binary files and unimportant files and things like password files
23:06:11
_death
verisimilitude: versioned files is wrong.. and git is progress, as it tracks not files but changes
23:06:22
buffergn0me
verisimilitude: The problem with per-file versioning is that it is only as powerful as CVS. You want to track changes across multiple files at once
23:07:26
verisimilitude
You could even have the file system have a means for relating files in this way, when it becomes understood that a file isn't just a bag of bytes and can have real attributes.
23:08:28
verisimilitude
File versioning is when you save changes to a file, you still have access to the file's older version and yet older versions.
23:10:20
aeth
I have emacs store them all in .~ so e.g. ~/foo.txt will have ~/.~/foo.txt~1~ etc. and it will never delete old ones because I set it like that. Emacs only does this if it doesn't detect it's in version control (it even does it for files in version controled directories that aren't themselves version controlled!)
23:10:27
pjb
name.type.~version~ Unfortunately most implementation cannot translate logical pathnames versions. For example, ("H:**;*.*.*" "/**/*.*.~*~") translates #P"H:tmp;foo.bar.42" to "/tmp/foo.~bar" in ccl.
23:11:34
aeth
I still prefer git to Emacs's backup system because per-file has major problems once you move past one file. Does foo.txt~123~ line up with bar.lisp~57~ or do they not even line up at all because I never had a working state among the backups? (git, since you explicitly check in, ideally has every combination of files working)
23:13:45
buffergn0me
aeth: I put everything in a single folder in my home directory (full pathname gets appended to filename that way), even files in VC. It's a good backup system, not a very good version tracking system
23:14:18
_death
no.. it's only requirement is for a repository to be in a directory, and the git database is then a .git directory in that directory
23:15:47
verisimilitude
Well, that's good then; my website is completely flat and I wouldn't want to change that.
23:16:46
_death
that's no problem.. just do: git init ; git commit -am 'initial commit' and you have a repository
23:18:33
verisimilitude
I've still yet to learn how to use git, along with deciding whether I will, but if I'm not required to introduce directories, then that doesn't rule it out.
23:19:11
_death
the only thing this does is create a .git directory with the database containing the current state
23:20:59
_death
you can inspect it using a tool like gitk, change stuff and use "git gui" for easily committing (or see http://emacsrocks.com/ episode 17 ;), and finally delete the .git directory if you're not satisfied
23:24:12
verisimilitude
Alright; I'm very wary about file I didn't create myself that are public, as is.
23:28:21
_death
also, re-watching that episode, it's not really an introduction to magit.. so some other one is to be found
23:45:38
_death
(on first use, git may ask you to set a name and an email.. they should also add blood type, may come handy on one stressful day ;)
0:41:02
slyrus_
Ugh... My xml-foo is rusty. Are there any libraries for dealing with XML schemas (besides cxml-rng -- I want old school XML schemas not RNG schemas -- I think).