freenode/#lisp - IRC Chatlog
Search
14:39:15
schweers
I know what quicklisp does. I just don’t use it on this project because I need a bit more control over where my third party code comes from
14:39:40
Xach
oh, i mean in addition to the stuff it downloads. the local-projects mechanism is what i meant.
14:40:22
Xach
if you put all your third-party libraries in ~/local-projects/ it would load only those, for example. or if you didn't want to use quicklisp, you could use it to make an empty bundle, and then use the bundle's local-projects directory. there are many other options that don't use quicklisp, too.
14:44:20
pjb
ebrasca: first, why do you want to design a new file system? The guys at ext2/3/4 seem to be doing a very good job at designing a file system.
14:46:39
pjb
I don't see how you can list the versions, there's a last-version, but not previous-version.
14:48:33
pjb
So, basically you would just need to take ext4 and extend its inode with version-number and previous-version fields?
14:49:52
pjb
The rest would have to be implemented in the userland, such as would cp copy all the old versions, or just the last? This could be options.
14:52:10
p_l
in this case, the MTTR was heavily increased by ext lacking any checksumming of metadata
14:52:58
pjb
Anyways, there's also the idea of not having a file system at all, but instead to implement a persistent storage of objects. So you could in a way implement any kind of file system by defining some classes in memory, and their objects would be written or read from the disk. See the EROS OS.
14:56:12
pjb
Also, remember that old computers had static ram or magnetic core memory, which was persistent. Imagine working with such a system, when you can shut down the computer and power it up again, and still have all your objects and processes ready?
14:56:50
pjb
So there's no notion of saving and loading, but just making copies into dictionaries or indexed databases.
14:59:10
splittist
Indeed. As technology recedes into the past, it also seems to recede into the future, leaving us with an eternal present...
15:00:19
dlowe
I was hearing a while ago about memory made out of nano-cores, which would give us ultra low-power persistant ram
15:00:53
p_l
dlowe: MRAM, you can actually buy it, but densities are pretty low due to manufacturing requirements
15:07:42
p_l
verisimilitude: if you use modern standby or S3 sleep then you have same level of memory persistence
15:11:36
beach
The other day I was thinking that data bases, and also persistent stores requiring explicit actions to save object, essentially force the loss of identity of objects.
15:13:23
beach
Sure. But then, that technique would have some serious impact on the programming style.
15:13:33
pjb
Yes, and furthermore, in EROS (or was it KeyKOS, I may be mixing them), the addressing space was large enough that the network was also included in it: you could "mount" remote capability spaces in your addressing space, so you could enforce identity of object over the whole network.
15:14:51
p_l
beach: I think the worst bit is when people try to *naively* map external memory onto other kind of objects. Which often results in the same way as if someone wanted to use CAR on multi dimensional array
15:17:57
beach
ebrasca: If you follow p_l's suggestion to abandon pointer identity in favor of some external identifier for objects, then your CONS cell will no longer be represented by a Common Lisp pointer, but by some arbitrary key, so CAR and CDR will no longer work.
15:21:56
p_l
shka__: core component of OS/400 is a) single address space covering RAM and disk b) built-in database technology including relational one
15:22:41
Bike
the two pointer trick is that since A xor B xor A = B, if you store A xor B, you can get A or B out as long as you have the other. it's not that complicated, just weird
15:51:00
jackdaniel
making winow manager based on mcclim would require introducing sheepts capable of adopting other sheets
15:53:09
ebrasca
jackdaniel: I think mcclim is good. Here link https://github.com/fittestbits/McCLIM for mezzano ( I think it is WIP )
16:33:50
jackdaniel
most work would be introducing protocol for adopting frames in a sheet, I believe backend primitives are already implemented by fittestbits
16:34:13
jackdaniel
you may read about the black board pane if you think about floating windows (I haven't tested it myself)
16:49:16
beach
evanpeterjones: That might be the case, but this channel is restricted to Common Lisp.
16:51:34
evanpeterjones
actually I've been teaching myself CL for a few weeks and used it on a few projects, but entertained the idea of using clojure.
16:54:43
evanpeterjones
don't stan the JVM, or the non-standard m-like-expressions for different types, but the interop with java makes it seem very useful.
17:26:59
makomo
hm, is it possible to somehow attach slime's debugger to a running lisp image (running swank of course) which has already invoked the debugger because an error happened?
17:27:34
makomo
basically, the image errored and entered the debugger, i connected to it using slime but now want to use slime's debugger instead
17:30:18
makomo
i tried using slime-list-threads and then attaching to the thread which entred the debugger using slime-thread-attach but i'm not sure whether this does what i think it does
17:30:40
verisimilitude
Are there any restarts that would be appropriate to use for this available, makomo?
17:31:24
verisimilitude
You could, say, evaluate an expression that calls INVOKE-DEBUGGER within the native debugger.
17:31:57
phoe
makomo: rebind the *debugger-hook* with a slime hook and call invoke-debugger in the original debugger
17:36:19
phoe
you give it the condition that the standard debugger was invoked on - usually that's the value of some dynamic variable
17:39:29
phoe
only the way to invoke a debugger is standardized via INVOKE-DEBUGGER. once you're in, your implementation defines what's going on.
18:13:40
evanpeterjones
particularly if you've used any really good libraries for image processing, web scraping, or database integration
18:27:12
makomo
verisimilitude, phoe: i ended up writing my own debugger hook which then forwards to swank's debugger hook
18:27:43
makomo
also, instead of starting the swank server right away, i start it *within* my debugger hook
18:27:59
makomo
then, i set up 2 restarts. one invokes the standard debugger and the other invokes swank's debugger
18:29:01
makomo
after setting up the 2 restarts i signal an error myself explaining what the original error was and what the 2 restarts are
18:30:40
makomo
i have a tool written in lisp which is invoked as part of a bigger build system. if the tool fails, i want it to drop into the debugger and allow me to see what went wrong
18:32:11
pjb
makomo: sometimes, (handler-bind ((error . #'invoke-debugger)) (tool)) is all that is needed, if it doesn't do it by default.
19:20:44
makomo
there's swank::*connections* but i'd like something that's actually exported (and possibly documented)
19:43:29
jackdaniel
and if a superficial requirement is to have the symbol exported, then export it and forget about the issue
19:45:58
makomo
there's no requirement. i was just hoping that there's an "official" way to do it, i.e. that there's a proper protocol
20:16:33
dim
I'm close to having c:build-program work for pgloader, but I don't quite get what the epilogue should look like
20:17:17
dim
given (c:build-program "/tmp/pgloader/pgloader" :epilogue-code '(cl-user::pgloader-image-main) I get The function PGLOADER-IMAGE-MAIN is undefined., but it's defined in the same "src/save.lisp" file as where the call to c:build-program is found...
20:29:17
jackdaniel
c:build-program *is not* save-lisp-and-die, it builds application from other artifacts
20:29:31
jackdaniel
so if this function is not in one of these artifacts, then indeed function won't be accessible
20:33:45
brainacid0
hey, im very new. i was curious if there is a way i can write my code in one line and have the editor do the indentation?
20:34:29
phoe
brainacid0: it's not your task, your editor should count the parens for your and automatically indent your code
20:35:08
phoe
vim should be capable of that. I'm not a vim user myself though so can't give you concrete pointers.
20:37:56
brainacid0
see im not really a programmer per se so i dont have the ey and thought process down
20:57:54
makomo
what's the way one is supposed to use named-readtable's IN-READTABLE? just stick it as one of the first top-level forms within your file?
20:59:57
makomo
Xach: and the way IN-READTABLE is implemented will ensure that this readtable is used while reading the current file only?
21:00:37
makomo
i suppose that has to do with the fact that both LOAD and COMPILE-FILE bind *READTABLE*?
21:04:35
makomo
i see. one last thing, since IN-READTABLE is executed in all 3 EVAL-WHEN situations, then any usages of READ within that file will use that readtable, right?
21:05:29
makomo
unless you (or the code that indirectly calls READ) rebinds *READTABLE* to something else
21:06:19
makomo
so i guess that in general one should be very careful when writing code that uses READ, taking care to explicitly bind the readtable that you want to use, etc.?
21:12:37
makomo
mhm. i just finally diagnosed an error which was due to Swank calling READ for whatever reason when slime-restart-frame is called. since some code modified the standard readtable, Swank's READ would use it god knows how and the reader function would error
21:12:57
Xach
it is bad to directly modify the standard readtable. i think some implementations protect against that?
21:30:33
makomo
Xach: i maintain a certain lisp tool that is used to generate c++ code. to ease that task, it has a reader macro which lets you easily embed chunks of C++ code (which support interpolation) into lisp
21:33:53
Xach
do you make use of the pretty printer dispatch for any of that? i've seen some interesting uses of it but mostly fall back to templated strings myself
21:33:58
makomo
and there's a little DSL which lets you define the C++ types and automatically register the generation of their serialization code, etc.
21:36:17
makomo
Xach: nope, but i never thought about it either (i'm not the original author of the core) -- all of it is templated strings like you say
21:41:55
Xach
makomo: ahhh. the pretty printer can do smart things with indentation and continued lines and conditional breaks and such. i've seen it used to write pretty struct initialization code for C, for example.
21:42:15
Xach
but if you're just piping through another formatter there is no real need to generate pretty code initially
21:42:59
makomo
also, i believe it would be hell to try t model the usual C++ style guidelines using the pretty printer
0:29:15
fouric
how can i check to see if a given generic function is applicable to a given object - without actually calling the GF?
0:33:05
pjb
(defmethod moo ((a integer) (b integer)) (+ a b)) (find-method (function moo) '() (mapcar (function find-class) '(integer string)) nil) #| --> nil |#
0:33:21
pjb
(find-method (function moo) '() (mapcar (function find-class) '(integer integer)) nil) #| --> #<standard-method moo (integer integer)> |#
0:46:06
Bike
find-method finds, well, specific methods. with pjb's example, if you tried it with (#<class fixnum> #<class fixnum>) it would find no method, even though the method on integers is applicable to fixnums.
0:46:21
Bike
there's compute-applicable-method, which gives you a list of methods given a gf and arguments
0:46:45
Bike
however, even if there are applicable methods, they may not be enough to form an effective method, e.g. if there are :around methods but no primary methods
0:55:35
fouric
which gets called on an object when it doesn't understand a message that was sent to it
0:56:13
fouric
i came up with https://gist.github.com/fouric/595724587ecf6021ad4cfce4facf63dd but i don't think it works entirely correctly
0:57:27
Bike
if you're already in no-applicable-method, you can assume the generic function isn't applicable, no?
0:59:52
fouric
if it doesn't, then we need to just call the normal ("primary"?) no-applicable-method
1:00:19
pjb
(find-method (function moo) '() (mapcar (function find-class) '(integer fixnum)) nil) #| --> nil |#
1:00:40
fouric
...and then reason i don't just invoke does-not-understand off the bat is because otherwise we'll recurse infinitely
1:03:41
fouric
i'm sorry, i still confuse "generic function" and "method" with each other because in other languages they mean the same thing
1:04:41
fouric
or, rather, a class either defines special behavior, or the normal CL machinery is used to signal that there's no applicable method
1:05:49
fouric
it could just be printed out, or maybe logged to a file, or maybe the reason the function was called was because RPC, and a response needs to be sent back over the network instead of signalling a condition locally
1:07:11
Bike
how would the system even get to no-applicable-method if there is a method matching the first argument?
1:10:26
Bike
let's back up another step here. the code you wrote is illegal. you can't specialize no-applicable-method on nothing like that, since it would override everything in the system.
1:11:14
Bike
then if you do, you could have no-applicable-method call does-not-understand. if does-not-understand is a normal gf and not one of your custom gfs, no-applicable-method in the case of lacking a does-not-understand method would not go into your method and there would be no recursion.
1:14:20
Bike
but in general i think you'll have to think this through more. multimethods and complex method combination make CL generic functions pretty distinct from the smalltalk object system...
1:23:43
fouric
Bike: it would override everything in the system, but only for classes that didn't have a does-not-understand method defined, and that should be OK, right?
1:24:17
Bike
i mean, consider if someone else wnated to do something like this, and you both tried to define an unspecialized :around
1:27:55
fouric
i don't quite understand how :before/:after/:around methods are combined with primary methods
1:28:48
specbot
Standard Method Combination: http://www.lispworks.com/reference/HyperSpec/Body/07_ffb.htm