libera/#commonlisp - IRC Chatlog
Search
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
4:27:21
beach
You could format your suggestion as a WSCL issue if you like, but I think it is probably outside the scope of WSCL.
4:34:25
_death
well, there are other good arguments against unicode in the standard.. it keeps changing, very complex to implement, and probably too big for memory constrained systems
4:34:54
beach
phantomics: We already have other proposals that are great and still outside the scope of WSCL, like Bike's memory model.
4:35:31
phantomics
beach: I could do that, is there a good template to work from? _death: I would see this proposal as applying to the use of Unicode characters; if Unicode is not in use, it would not apply
4:35:47
semz
Another point is that you don't really win all that much by guaranteed (instead of conventional, as now) Unicode support in the language. Many programs that "support Unicode" actually support some arbitrary subset of it.
4:38:57
phantomics
I was just looking at ECL's code, ECL seems to use C's isalnum function to test characters, but docs I found for that function suggest it just matches the English Roman alphabet characters
4:41:09
phantomics
beach, those examples look good, I can write something modeled after those. I'm corresponding with Franz right now concerning their implementation and I'll bring up the UCD categories
4:41:09
Guest74
having standard unicode functions to determine types and uses of codepoints would certainly make multilingual font rendering easier. Though there are some systems implementing some of that.
4:42:14
phantomics
semz: that's what the docs said, they gave English Roman as an example so I'd guess the matching characters will be just the alphabet used with the locale
4:42:23
semz
although many big programs just set the locale to something like "C" because C's locales are capital A awful
4:44:51
phantomics
I discovered this because having APL characters register as alphanumeric broke April's parser, which was puzzling at first. It definitely helps to have uniform character treatment for text processing
4:45:12
etimmons
minion: memo for scymtym_: Do you know of any success stories using Eclector as the reader for CL:LOAD (without completely replacing the implementation's reader)? I tried using Fare's reader-interception, but it has issues. Trying to decide if I should fix them or hop to something else that already works.
4:50:35
etimmons
I've got a client for eclector that can change how package lookup is done on symbols (kind of like a poor man's version of first class environments). I'd like to also use it to prevent the use of ::