freenode/#lisp - IRC Chatlog
Search
19:14:50
jasom
oni-on-ion: It was ARPA that funded the PDP-10 with an entire address space of core memory for MIT though, I have no idea how much that cost, and I heard it was never that reliable.
19:16:47
jasom
oni-on-ion: Yeah, they left the "D" off so they could pretend it wasn't military, but at some point gave up pretending I think :P
19:19:03
jasom
ah in 1973 they amended the charter to be "direct mil\itary application" only apparently
19:26:10
pjb
Well, anyways, even if you do pure civilian research on pure private founds, as soon as the US government deems it good for national security, they've got the laws to take over all of it, and forbid you to ever talk about it.
19:26:49
pjb
So, in essence, all the activity in the US is directed directly toward military applications.
19:30:13
phoe
when I'm defining protocols, it doesn't allow me to define duplicate functions in dependent protocols
19:46:56
jasom
razzy: defun is global, but the name for a function is a symbol; you could have a macro that does `(defun ,(gensym) ...) and you'd have a global function with a name that is unreachable
20:13:11
aeth
Almost every local function can also be a global function that's not exported. The main difference is that you might need more arguments to the lambda-list in the latter because you can't rely on the outer function's scope, but that makes things more explicit.
20:13:36
aeth
(I say "almost every" because if I speak in absolutes on IRC someone will find a counterexample. I think it's actually every)
20:15:24
jasom
definitely not every because closing over lexical variables is different from closing over dynamic variables in important ways, and non-top-level DEFUNs are odd.
20:18:57
pfdietz
Also, lexical things around defuns may not play nicely with threads, while dynamic variable bindings are (usually?) thread-local.
20:21:14
aeth
jasom: Depends on what you count as equivalent. Yes, you can no longer mutate x from within the flet function if you move it to outside, but you could have it return a value that is then set in the calling function. Since you have control over the API, whether or not that counts as equivalent is debatable.
20:22:30
jasom
there are APIs that cannot be easilly expressed without closures. It is possible they are all bad APIs though.
20:25:31
aeth
jasom: I guess you could make an argument that explicitly creating those closures from an external defun and binding the returned lambdas could still be a better API than using FLET, though. Because you could use it from multiple functions.
20:38:37
trittweiler
I try to define functions locally that are very intrinsically coupled to the parent function. Top-level functions are coupled to an object or the package instead. Local functions are not directly invokable from the REPL, so that already draws a "natural" line. Ease of meaningful naming is another thing that's often difficult for local functions (it's usually a frob-foo, grovel-foo, or similar.)
20:43:21
pjb
aeth: usually, local functions are closures. To have them global, you'd need to make them objects.
20:45:46
jasom
I used to prefer global functions just because slime/sbcl just handled them a lot better (v, what it looks like in backtrace &c.). The tooling has improved considerably since I made that decision though.
20:46:19
trittweiler
if the closed-over variables are not modified in the local functions, they can be trivially lambda-lifted
0:01:48
eschulte
Does anyone know of a serialization library appropriate for deserializing from another programming language?
0:02:20
eschulte
in particular I'm thinking of something I could combine with snooze to provide access to CL objects from another language through a REST API (and a wrapper library in the other language)
0:03:13
eschulte
oh, thanks!, that seems obvious. do you know off hand how it supports CLOS objects?
0:32:18
no-defun-allowed
has anyone ever made a program which mutates some lisp code randomly until it runs without errors?
0:33:33
eschulte
no-defun-allowed: close, see https://grammatech.github.io/sel/#Top but honestly it's support for C/C++ and assembler are much more mature than it's lisp support
0:34:03
eschulte
specifically this example usage shows repair. https://grammatech.github.io/sel/Repair.html#Repair
0:36:54
nydel
hmm, i return to an old project depending on :USOCKET package and it seems the package function #'SOCKET-SERVER is not defined. is this my end? or has usocket changed?
0:43:50
nydel
Xach: thank you - i was able to ql:quickload that right away. is this package connected to :USOCKET?
0:50:59
nydel
odd, as far as i can tell, what used to be :USOCKET is partially in :USOCKET-SERVER even though slime-mode autocompletes some functions from the latter with only the former loaded.
4:01:55
aeth
You know what's cool about CL? You write something and 19 times out of 20 it'll work in SBCL, CCL, and ECL without having to work around various quirks.
5:01:36
forumulator
Hi guys. Need a little help. I'm trying to expand a lisp macro to product something like val(a)->val(b). However, `(,a -> ,b) doesn't give me the correct result.
5:09:46
beach
forumulator: They work on S-expressions. Spaces are just related to how things are printed.
5:11:43
forumulator
I could do a format, but it only outputs strings. How do I convert string to lisp code?
5:12:21
beach
If you are new to Common Lisp, that is definitely NOT something you want to do. You will get into all kinds of trouble with readtable-case and packages.
5:14:18
forumulator
beach: I dont' care about messy at this point, I've spend hours breaking my head on this. Lisp is a major programming language, and there doesn't seem to be sufficient macro documentation.
5:15:25
forumulator
There is some stuff, but I couldn't find advanced docs for the stuff I'm trying to do.
5:17:37
forumulator
beach: But yeah, university class. Everything's good except for this final part. Any idead?
5:20:26
forumulator
Please don't mind, taking help on an assignment is a bit sketchy. Even if they are ones like this.
5:24:09
beach
In a language like C, "enums" are used to associate compile-time names with small integers at run-time.
5:24:28
beach
But Common Lisp has symbols at run-time, so there is no great use for such a facility in Common Lisp.
5:25:42
beach
Basically, constants with names like planet->mass->mercury are pretty useless in terms of programming.
5:27:52
beach
In fact, if you have to construct that kind of symbol at run-time, you would use a hash table (that of the package) implicitly anyway.
5:30:28
forumulator
Got it. Have to go to school now, thanks for your help! I'll ask my prof the point.
5:30:30
flip214
well, I don't see a package PLANET with a symbol MASS and a property MERCURY as pleasing.
5:34:19
flip214
although, for a single-level hash table, emulating multiple levels via a _single_-character (so it's "trivial" to split [ie. in C to change to a NUL ;]) isn't unheard of
6:32:12
jackdaniel
phoe: common lisp doesn't give you weak data structures at all. as of compilers, usually you have hash tables with weak keys, values or both and for general structures you have a weak pointers
6:33:53
jackdaniel
that's why I've mentioned what some implementations provide. first part of the answer hints, that it was imprecise. if abcl provides weak heap, would that satisfy you if I'd said: weak heap is there too. ?
6:35:11
shka_
phoe: please note that in practice, weak pointers in garbage collected language have a limited use
6:35:42
jackdaniel
I'm curious what use do they have in a language, which is not(!) garbage collected
6:37:32
shka_
jackdaniel: i would not say so, most people think about tracking GC when they are talking about GC
6:38:18
jackdaniel
shka_: I'm very sceptical about this claim (especially in context of discussing data structures with weak references)
6:38:27
Shinmera
Refcounting helps in tracking garbage and disposing of it. It is a gc technique, whether people like it or not.