freenode/#lisp - IRC Chatlog
Search
11:09:22
pjb
aeth: now of course, nothing prevents you to defined a module abstraction, where you could declare that you'd export from the module either the function or the variable or the type, or whatever else kind of binding, and when you import the module, you'd get only that. That would be independent from packages…
11:28:15
schweers
has anyone here used the code coverage facility of CCL? I set ccl:*compile-code-coverage* to t, recompiled my sources and ran the tests. So far so good. When I run CCL:REPORT-COVERAGE, I get an error which claims that NIL is not of the expected type STRUCTURE.
13:02:05
pfdietz
stylewarning: that quote was originally by James Nicoll, and it was about English, not Common Lisp. https://en.wikiquote.org/wiki/James_Nicoll
13:39:47
asdf_asdf_asdf
In manual: http://www.sbcl.org/manual/ is (slot ...). I want pass function WindowProc as alien-type-function. How it do?
15:36:01
beach
asdf_asdf_asdf: Given what you are trying to do, there are probably a lot fewer people than usual that are able to help you.
15:44:35
asdf_asdf_asdf
Bike, yes CALLBACK, code is here: https://docs.microsoft.com/en-us/windows/desktop/learnwin32/your-first-windows-program
15:45:58
pjb
Something like (cffi:defcallback my-win-proc …) (setf (lpfnWndProc wc) (cffi:callback my-win-proc))
15:53:04
beach
asdf_asdf_asdf: If you are trying to learn Common Lisp, I am afraid you are going about it the wrong way. But perhaps I am mistaken and you are an experienced Common Lisp programmer.
16:15:10
Nilby
They're not exported, so probably shouldn't be used. i.e. you have to use them with 2 colons as sb-alien::define-alien-callback.
16:19:58
Nilby
Here's some examples of Windows GUI code: https://github.com/fjames86/ftw/blob/master/ftw.lisp https://github.com/Zulu-Inuoe/winutil https://github.com/jdunrue/graphic-forms
16:24:14
oni-on-ion
asdf_asdf_asdf, did you see that link i posted ? or are you just kind of on your own little adventure here
16:33:18
jkordani
minion: memo for schweers did you figure out what was going on with your code coverage issue?
16:36:18
jfe
i have a plain function that inputs and outputs slists. i want to use the *result* of that function in a macro, but i'm not sure how to do it. is there a trick for doing this?
16:38:10
makomo
jfe: a macro's body is just normal lisp code that can use whatever it likes. just call your function within your macro's body.
16:41:34
sjl_
something like `(labels ((test (tuple) ,(predicate-bind predicate (rel-schema rA) 'tuple)))) ...
16:43:36
Bike
if i'm reading this correctly, the predicate-bind function needs an actual schema object
16:44:09
sjl_
but the rel isn't there at macroexpansion time. all the macro actually gets is what you give it: the symbol REL
16:46:54
jfe
asdf_asdf_asdf: it's as sjl_ describes it. i need the value of 'rel at macroexpansion time but i have no way to get it.
16:46:58
Bike
macro functions are evaluated at compile time. at compile time, there is no schema. so what you want isn't really possible. if i understand correctly.
16:47:07
sjl_
I don't know what this is actually trying to *do* (it looks like some kind of query language) so it's tough to say. If I had to guess, I'd guess that what you actually need is 1. a function that takes a schema (your rel thing) and a query (the list (= 4 :foo)) and does your query.
16:47:24
sjl_
2. A macro that's a thin layer on top of that function, so you don't have to manually quote that list
16:49:48
sjl_
Doing it like that is nice because you end up not only with the macro, but also with the function, which you can MAP, ALEXANDRIA:CURRY, etc etc
16:51:10
makomo
indeed. a lot of the time you should treat your macros as "the cherry on top" which just provides nice and convenient syntax and does all of its work by forwarding to your functional abstractions
16:51:23
sjl_
e.g. I'd imagine the macro would look like (defmacro rel-select (rA query) `(perform-rel-select ,rA ',query))
16:53:46
jfe
a query might look like '(< 3 :foo). then i convert this expression to '(lambda (tuple) < 3 (nth <'foo' column number> tuple))
17:07:44
makomo
stuff like querying the plist (:hello (:there 123 :world 456)) with a "nested indicator" '(:hello :world), or merging the nested plist with another nested plist, adding a key if it doesn't exist (recursively, just like mkdir -p creates directories), etc. etc.
17:08:17
makomo
seems like quite useful functionality for macros that have non-trivial syntax based on nested plists
18:11:39
pjb
Actually, sbcl compiler is one of the fastest CL compiler there is, since it's compiled using sbcl compiler itself, which produces one of the fastest CL native code.
18:33:30
oni-on-ion
this is all i can find about it, but does not say much about the compiler itself: http://www.ffconsultancy.com/languages/ray_tracer/conclusions.html -- in my experience sbcl, gcc, ocaml are equally awesome
19:31:06
asdf_asdf_asdf
Hi. How define body of routine? After defined routine I must defined body this routine? How it do? Thanks.
19:32:22
Xach
asdf_asdf_asdf: there is no body. it is declaring an interface to an existing foreign function, so it is for specifying the arguments and return type.
19:36:06
Xach
asdf_asdf_asdf: scratch that - no matter what the answer is, i cannot help - but maybe someone else can.
20:11:15
aeth
asdf_asdf_asdf: Usually you want to find a JSON version of the API that you can parse rather than doing it manually yourself... afaik.
20:11:56
aeth
If it's a common "I have to interface with this" library, then JSON (or XML) versions exist for exactly this purpose, sometimes officially.
20:14:32
borodust
claw is quite beta yet and only docs is me (apart from ones that can be borrowed from cl-autowrap)
20:16:35
borodust
if structs-by-value are not tossed around by the api in question, that should be a piece of a cake
20:17:27
borodust
lemme know what header you need a wrapper for and i can arrange it in 15 min or smth
20:17:33
aeth
Bike: In case I was unclear, I don't mean the API is literally XML or JSON, I mean an API is often described in XML or JOSN, e.g. for Vulkan. https://github.com/KhronosGroup/Vulkan-Docs/blob/1.0/src/spec/vk.xml
20:20:30
aeth
It would be incredibly amusing (and not *entirely* surprising, since Microsoft has tried like 20 different APIs) if you could interact with Windows directly via XML.
20:28:59
defunkydrummer
minion: memo to asdf_asdf_asdf: there are already Win32 API bindings out there, see https://github.com/Zulu-Inuoe/win32 for an example.
20:31:30
defunkydrummer
minion: memo to asdf_asdf_asdf: also this guy has several bindings to various Win32 APIs: https://github.com/fjames86