libera/#commonlisp - IRC Chatlog
Search
11:31:56
VincentVega
phoe: Nilby: OK, it's actually quite nifty with a symbol-macrolet https://pastebin.com/WN3NU68j except for the deleting unreachable code warnings.
11:42:49
phoe
give me a few hours to finish work and then I'll be able to show you if no one does before me :D
11:46:09
Nilby
Nice. Nearly zero run cost conditional logging. Probably less code bloat than C++ templates. I'm curious to see phoe's extra fancy way.
11:47:52
VincentVega
Nilby: yep, with a custom when-flag, the warnings are gone, will be curious to see another way too : )
13:35:14
phoe
I use &environment to communicate between the outer macro(s) FLAG-LAMBDA and the inner macro(s) FLAG-WHEN
13:35:58
phoe
SYMBOL-MACROLET is a way of writing stuff into the compilation environment and MACROEXPAND-1 with a symbol is a way of reading it
13:36:33
phoe
in the fully macroexpanded code, you can ignore L29 completely - it's just noise leftover by the communication
13:37:18
phoe
what matters is the fact that the (IF X (LAMBDA ...) (LAMBDA ...)) structure is what you seem to want, and a total of 2^n functions will be generated based on the combination of flags
13:38:22
phoe
a tidbit is my use of LOCALLY instead of PROGN to permit declarations, since you have a lot of #.*burn-baby-burn* style of declarations
14:42:45
phoe
and the other being symbol macros whose only purpose is to exist in &env as a way of passing information deeper into the macroexpansion process
14:49:59
phoe
VincentVega: in your previous example, you could substitute SYMBOL-MACROLET for LET and it would still work
14:50:58
phoe
in your previous example, you had (when x ...) turn into (when t ...) or (when nil ...) which generated unreachable code warnings
14:51:22
phoe
now the macro simply doesn't generate any code for the cases that could previously generate something like (when nil ...)
15:10:24
VincentVega
phoe: I take it you wouldn't mind if I use this stuff in my code (under lgpl) quoting you as the author?
16:17:44
phoe
(oh, and don't export the %TRUE-FLAGS% symbol - it's important that users don't have the ability to shadow it in any way)
16:34:46
phoe
Guest746: it's one of the basic uses - ensuring that MACROEXPAND-1 can expand locally defined macros
16:35:17
phoe
otherwise your macros that need to expand other macros will break when MACROLET and SYMBOL-MACROLET come into play
16:42:15
Guest746
yeah i haven't run into any nested macro opportunities yet. I suspect it's in the future for my binary reader/writer so i'll try and keep this stuff in mind.
16:51:25
phantomics
April has progressed a lot, I'm checking off the final todos before a new release, been testing it with all different CLs
16:52:35
phantomics
I just discovered that Allegro CL apparently doesn't know what "alphanumeric" means - try (alphanumericp #\←) and observe the results
16:55:07
phantomics
It seems that in Allegro, (alphanumericp) gives nil for the common keyboard symbols that aren't alphanumeric like +, / and @ but many other unicode characters not on the keyboard will return T
17:04:44
phantomics
You can find the matching characters in an implementation with (loop :for i :below (expt 2 16) :when (and (code-char i) (alphanumericp (code-char i))) :do (princ (code-char i)))
17:06:09
phantomics
Meanwhile in Allegro, all sorts of weird stuff matches, beware though as it may crash your Emacs
17:48:20
phoe
and then call FUNCTION-INFORMATION with the function name plus a lexenv if you have it
17:52:58
CodeBitCookie[m]
so I want to send keyboard and mouse input automatically with Common Lisp. Is there any way you suggest that I go about this?
17:52:58
CodeBitCookie[m]
I would prefer if there were a cross platform solution but if the library depends on Xorg or Windows only stuff then that's fine too.
17:55:28
jackdaniel
Guest746: cltl2 defines the environment access api that contains necessary information
17:55:40
jackdaniel
this information was dropped in the final ansi standard, but some implementations still implement it
17:56:53
Guest746
so no trivial-cltl2? I'm not sure it's a big deal since I can't find local-sockets anywhere besides the same ones.
17:58:58
Guest746
this is for a probably bad idea to autogenerate dbus interfaces if ftypes are declared.
18:02:34
Guest746
well it doesn't help to generate a dbus interface if you don't have a socket to communicate with :)
18:04:21
Bike
isn't there a dbus library that can automatically generate an api from the dbus introspection stuff?
18:08:29
Guest746
well, i'll have to look at that. thanks. Though it seems to generate from introspected stuff, which is the other half. I'm thinking about the part of generating from lisp functions.
18:56:19
jcowan
fwiw, Interlisp has two structure editors built-in, one TTY and one GUI; most Interlisp programming is done in the GUI (one function at a time, as in Smalltalk)
20:57:51
theothornhill
I didn't find any frameworks for using GraphQL in common lisp, so I made one. It isn't done yet, but it works. It follows the spec closely, and aims to be fully compliant when I'm done. However, I'd love to get feedback so that I can improve things before the apis settle too hard. So, shamefully posting it here. Sorry if it is the wrong forum :)
20:59:22
theothornhill
There's also some crude docs here, if you're interested: https://man.sr.ht/~theo/gql/
21:07:13
stylewarning
(In case you didn't see on Twitter or Reddit:) I wanted to invite Lisp IRC to a small Advent of Code contest to use Coalton (a DSL in CL) with a variety of prize categories. Check it out :) https://coalton-lang.github.io/20211129-aoc-contest/
21:08:58
jasom
stylewarning: if my ML knowledge is "I did one OcaML tutorial 20 years ago" what's the time to be able to actually do stuff in Coalton?
21:13:03
rotateq
would be very interesting for me like coalton on its own, but i just have Haskell and not ML experience beside the main stuff :)
21:30:29
stylewarning
jasom: Probably within an hour, especially if you grok type classes OK (which are like an 'interface', 'protocol', or 'trait')
21:33:26
stylewarning
rotateq: Yeah it changed a lot since that time. You might be interested in reading https://coalton-lang.github.io/20211010-introducing-coalton/
21:38:39
stylewarning
jasom: I might be underestimating you, an hour is maybe too much. Knowing all the other stuff you've done, reading this is probably 10 minutes or less :) https://github.com/coalton-lang/coalton/blob/main/docs/intro-to-coalton.md
23:06:11
rotateq
dre: if you have a question right now, go on :) no guarantuee i can answer it fully
23:11:25
dre
maybe a month in earnest. but progress is slow after a long day of procedural programming work