libera/#commonlisp - IRC Chatlog
Search
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
23:20:07
dre
rotateq, just then I tried this without doing any googling, am I doing it right? https://dpaste.org/uDve
23:20:38
dre
also sorry about indents. I'm using vim as my editor and we all know what a bad idea that is
23:21:38
rotateq
but me and some other people use spacemacs, it comes with the editor part as vim-like
23:21:43
dre
I'm using vim-slime. it's by far the best solution I've come across ( using tmux /sbcl as the repl
23:22:12
dre
I've tried it and it just doesn't quite feel the same. I do keep thinking that I might one day make the change to emacs, but.. i dunno when. time investments and all that.
23:24:53
Guest74
anybody have an AoC utils they use? I thought I had a bunch but looks like I just got stuff to load and parse the inputs.
23:29:27
Bike
this is a bit inefficient, since it will redo sums that didn't work. you could do (block nil (mapl (lambda (ls) (let ((item (first ls))) (mapc (lambda (x) (when (= (+ item x) 2020) (return (* item x)))) (rest ls))))))))))))))
0:04:53
rotateq
dre: do you already know the macros WHEN and UNLESS ? maybe better talk about this in #clschool
0:25:01
kagevf
dre: I got into emacs using org mode first to take notes ... it was helpful for getting used to emacs itself ... a few months later I started learning CL and was already accustomed to using emacs
0:27:01
kagevf
dre: I've been using Vim for 10 years. at first I tried spacemacs, but it was too slow (for my setup anyway) ... I just went with native emacs key-bindings ... it's not that big a deal, and your muscle memory catches up pretty quick
0:27:37
kagevf
I use emacs for CL and org mode, and vim (or something with a vim plugin) for everything else ... it works out alright
0:28:49
kagevf
I get the feeling that emacs has been fine-tuned over the years to be really good at editing sexp's ... so IMO it's worth making the investment to learn it if you plan on hacking a lot of Lisp
0:30:14
kagevf
emacs key bindings pop up in a lot of places too ... like bash, tmux, apparently in Apple GUI (not sure it's what I heard)
0:31:20
semz
There is a SLIME knockoff for Vim (SLIMV? VLIME? something like that), but I can't vouch for its quality or how it compares to the original.
0:31:38
pjb
dre: I used vi a long time ago, on A/UX. Then I switched to NeXTstep and emacs. It's possible!
0:32:46
semz
I was in a similar situation as you when I started out and have to say that you can get gradually used to Emacs
0:32:54
dre
the nicest I've found is "vim-slime" but it means you have to run sbcl in a tmux split, and then vim-slime will use a tmpfile to write to the other tmux terminal
0:34:14
kagevf
in emacs / slime you can print an object in the repl, and then "inspect" it ... C-c C-v i ... that's pretty useful
0:35:12
dre
my only real issue is that python support on emacs seems to be a bit sub-par? or atleast the LSP support.
0:55:38
GreaseMonkey
someone mentioned VLIME earlier... my experience is it has a nasty habit of forgetting how to indent Lisp code
0:56:35
GreaseMonkey
if it weren't for that it'd be fine, but nope, that bug renders the whole damn thing unusable
1:00:42
ldb
nope. sly gets better indenting by communicating with common lisp subprocess, I guess it can not be get right if having no specifc knowlege about common lisp
1:42:12
LoopMacro
Recommendations on a unit test framework? I used LISP-UNIT a few years ago. Others I should consider?
1:43:08
hayley
I usually use Parachute. But there is still no feature that has it print "Where we dropping, fellas" before running tests.
1:46:41
LoopMacro
Much appreciated. I see a new one called ROVE, but don't yet know anything about it.
1:49:56
hayley
When I was working on the SICL hash tables, which had tests using Lisp-Unit, I ported the tests to Parachute, and then ported them back when I was done working on them. I don't remember why.
1:52:18
stylewarning
But i've been using FIASCO for 6-ish years now so maybe some cooler things exist
1:52:20
jeosol
stylewarning: thanks, no need to apologize; I was just confused by the sequence of messages
1:52:57
jeosol
but not in a full CI/CD workflow, just running simple system level tests. I will like to get to the former
1:53:35
LoopMacro
In the summary of the link I posted, the author lists Parachute, Fiasco and LispUnit2 as #1, #2, and #3, respectively.
1:59:06
stylewarning
Not as cool as I thought it might look. https://usercontent.irccloud-cdn.com/file/7TNLrpkM/1638323934.JPG
2:01:00
jeosol
LoopMacro: I should take a look at that sabracrolleton link. He has done useful comparisons in the past (json, logging, and unittest). I like to see the updated information on testing
2:01:33
stylewarning
Line 5674 is pretty marvelous https://usercontent.irccloud-cdn.com/file/yd6hMVkP/1638324077.JPG
2:02:57
phantomics
I just discovered how inconsistent (alphanumericp) is between implementations, they have widely varying ideas of what an alphanumeric char is
2:03:24
phantomics
You can count the matching char codes with (progn (defvar *aclist* (loop :for i :below (expt 2 16) :when (and (code-char i) (alphanumericp (code-char i))) :collect i)) nil)
2:04:26
phantomics
The lengths for different implementations are SBCL : 49088 CCL : 48391 ECL : 48757 ABCL : 49142 Allegro : 65438 LW : 124
2:05:01
phantomics
Allegro counts practically everything in UTF-8 as alphanumeric, the exceptions are mostly just characters on the keyboard: !, &, > etc.
2:05:59
phantomics
Meanwhile in LW, only these chars count: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
4:04:16
beach
What is the "UTF-8 range"? UTF-8 is an seconding that maps Unicode code points to byte streams.
4:09:33
phantomics
I know that for example the JVM only supports the Unicode code points up to 0xFFFF, that's why I wasn't able to create symbols using higher-coded characters in ABCL
4:10:04
hayley
The JVM uses surrogate(?) code points to support the rest of the Unicode code points.
4:10:56
phantomics
I chose 2^16 as the range of characters that all impls natively support, in order to compare what's considered alphanumeric by different impls
4:11:49
hayley
It appears SBCL uses "UCD general categories" to determine if something is alphanumeric.
4:12:09
hayley
(loop for n below char-code-limit for c = (code-char n) unless (null c) when (alphanumericp c) collect (sb-unicode:general-category c) into blah finally (return (remove-duplicates blah))) ⇒ (:LT :LM :LU :LL :ND :LO)
4:14:38
phantomics
Didn't know that, why does it require 3 bytes? It appears 2 is all that's needed to store those codes
4:15:37
beach
But UTF-8 is not about storing codes. It's about encoding the code points as a stream of 8-bit bytes, which is why I am asking about the role of UTF-8 in your statement.
4:16:40
phantomics
It's not actually relevant, as I now understand, I was referring to the set of characters with codes below 0xFFFF, which I chose to compare between implementations
4:16:50
hayley
UTF-8 takes additional bits to represent the length of a character, as a character is represented by a variable number of bytes.
4:17:26
phantomics
If you saw the numbers above, different CLs consider widely varying numbers of characters to be "alphanumeric"
4:17:43
hayley
...and subsequent bytes are tagged as "continuation" bytes, so that one cannot parse rubbish if they start in the middle of a character.
4:25:40
phantomics
This is one of those areas where an addition to the CL spec could be helpful, to determine which unicode characters should be considered alphanumeric