freenode/lisp - IRC Chatlog
Search
6:00:57
wooden
when asdf fails to load my project the backtrace in slime is all about asdf -- no links to the code of mine that actually failed to compile. is there a way to jump to the code that failed to load via asdf? the best i've found has been to go back to the sbcl repl and search the buffer up for "error", but sometimes there is no error.
6:04:01
flip214
in CFFI, is there a way to get automatic translator functions (from eg. an alist or a plist) to the foreign type?
6:04:41
pjb
flip214: yes. Write a library of such automatic translator functions, publish it, and then use ql:quickload to get it!
6:07:28
wooden
beach: it says that it failed compiling one of my source code files, but then every level of the stack is all about where asdf failed in *its* code
6:09:35
beach
I understand your problem. Welcome to the mediocre tool support for free Common Lisp implementations.
6:12:41
flip214
pjb: reading the source reveals that (cffi:defcstruct (name :conc-name my-struct-name-) ...) does 99% of what I need... why is that not in the documentation?
7:22:14
thijso
Annoying! The machine I run IRC on has a sdd with I think a loose connection on the board where the cables are, so randomly it dies because the HD gets lost. Trying not to bump my desk too much...
7:25:57
sindan
I'm loading a value from a place that might not exist; in order to implement a defalu value, is there any practical problem to writing (or val 0) instead of (if val val 0), "val" being the expression that might be nil? The expression is long so it's best to not have to write it twice.
7:27:48
beach
sindan: Semantically, you can write (or val 0), but you are sending the wrong message to the person reading your code.
7:29:09
beach
That says "If val is NIL, by which I mean that it does not have the right value, then use 0 instead."
7:29:42
beach
sindan: On the other hand, it would probably be better to use "unbound" to mean "not exist".
7:31:10
sindan
beach: I agree it's not the best optimization; the program is only for myself, so I was trying to not copypaste the expression twice.
7:37:51
beach
sindan: If val can be an arbitrary expression (and therefore not an unbound variable), you should bind it to a lexical variable to avoid multiple evaluations.
7:40:24
sindan
beach: ah yes, but rather use gensym if I'm going to use the macro in several places?
9:40:59
flip214
does anyone have an example of sending a (vector (unsigned-byte 8) (*)) via CFFI to a function expecting a char*?
11:15:39
vydd
flip214: something like https://gist.github.com/vydd/6484a05906ebc10595f6b7e15b41d048 ?
11:16:35
vydd
oh wow. so last time I visited was 2 years ago :\ Shinmera, if you still know what this was about, I'm happy to answer
11:17:23
jackdaniel
I feel stagnant, it doesn't feel as if you haven't said anything for two years, hm
11:24:17
drmeister
no-defun-allowed: So you have ABCL running as a Minecraft (Forge) mode but there's no documentation or any information on how to access the Java classes? What I would do starting in a situation like that is I would punch some trees and then take the wood and craft planks and sticks and use those to craft a wooden pick. Then you can mine for cobblestone and use that to craft a stone pick.
11:26:45
drmeister
ACTION usually spends his first night in Minecraft crying in a dark hole - trying to avoid zombies.
11:32:58
no-defun-allowed
drmeister: Oh, ABCL is very, very well documented and I got myself through some examples.
11:33:24
no-defun-allowed
But as a proprietary program, all the methods' names are obsfucated and you need a very big table of method names to translate your way out.
11:34:14
no-defun-allowed
For most mods, this is no problem, because the toolchain has a post-processing step that consults that table and replaces all the methods, but ABCL doesn't benefit from this as its method lookups are done at runtime.
11:35:26
no-defun-allowed
In #lispcafe we figured out where that table is and how to read it, and I was able to pull out a method (net.minecraft.client.Minecraft.getMinecraft) and call it using it.
11:37:04
no-defun-allowed
So now I just have to figure out Forge, which doesn't have any nice documentation pages with a list of classes and methods, and instead wants you to rip out some bulky Java IDE to work things out.
11:37:19
jackdaniel
I'm still waiting for a CL implementation written for a hardware built with mnecraft
11:38:32
no-defun-allowed
"Compiling Common Lisp to Minecraft Redstone", a paper by the S-expressionists published in ELS 2029
11:40:13
no-defun-allowed
The plan is to write a wrapper around java:jmethod (call it jmethod*) which performs this swizzling and I can work through a few Forge examples from there.
11:46:53
no-defun-allowed
drmeister: I advise you make charcoal early on, then make torches, so you can cry in a lit up hole at least.
14:08:51
thijso
Jeeshh. I've just about kicked my minecraft addiction, guys. Stop talking about that in here.
14:14:43
dlowe
as part of the forge installation process, they decompile your installed minecraft back into java code and then patch annotations into it. You're intended to read the code to find out what to tweak/override.
14:21:34
tourjin
is there any preassigned style in emacs like dark mode? white screen hurts my eyes.
14:55:47
drmeister
no-defun-allowed: Please keep me up to date on your minecraft/common lisp exploration.
16:07:41
thijso
If I do a (make-instance inside of a package, I shouldn't need to fully qualify the classname, right? I'm trying to indirectly instantiate a class, by doing (let ((class (intern (format nil "~a~a" classname suffix))) and then using that to (make-instance class ..
16:08:28
thijso
But it's not working. If I print out some stuff it looks like the difference is that it works with <package>::<class> and not with just <class>
16:08:38
Bike
depends on what you mean by "inside a package". that code will create the symbol with intern, so it'll be interned in whatever *package* is in place when intern is called.
16:09:22
thijso
yeah, but it's all inside the same file which has an (in-package :bla) at the top...
16:14:46
Shinmera
you can also do `(let ((*package* #.*package*)) ...)` to bind the runtime package to the one used during compilation.
16:23:32
flip214
minion: memo for vydd: thanks, but I'd hoped to _not_ touch the individual bytes - just push the address on