
Oho! Really nice stuff there!

hazel!!! amazing

i’ve been waiting for replit to add racket for ages… now i might try the same thing with pie

Using ...
with unquote-splicing
seems dubious to me. Your examples only splice fixed-size list patterns, but in general, the pattern `(,@sublist ...)
would have to make a nondeterministic choice about how many sublists to make and how to distribute elements between them.

Maybe your original example could be written `(,name -n ,nombre ... ... ...)
if match
supported ellipses as expressive as Racket’s syntax patterns do.

BTW: v8.1 PPA builds are up now. I sent an announcement e-mail to the ML but I think it got stuck in a moderation queue.

With the data in the left screenshot I got an “empty” form back (right screenshot). That said, I could finally submit the package when leaving out the .
in the tag todo.txt
. :tada:
Would there be a reason not to allow dots (and other characters) in tags? (The format according to the Github project page is actually todo.txt
, so it would make sense to use the .
in the tag.)

The package status page shows the URL git+<https://git.sr.ht/~sschwarzer/todo-txt#v0.1.0>
, which isn’t a valid https URL. Firefox expectedly gives an error message “The address wasn’t understood”.

The same URL is “behind” the Download
button, so that fails as well.

I have this function: ;; string-width : String -> Natural
(define (string-width s)
(define-values [w h b v]
(send (new bitmap-dc% [bitmap (make-object bitmap% 1 1)])
get-text-extent
s
(make-object font% 2 'modern)))
(exact-ceiling w))
Which should produce the number of columns a string should take up: > (string-width "a")
1
> (string-width "苹")
2
but unfortunately it requires the drawing library and 3 different classes. Since I want to use something with similar functionality to be included in the column-counters on input and output ports, I want to avoid depending on those things.
I tried to figure out how to use wcwidth
with the ffi: (define-ffi-definer define-ffi (ffi-lib "libc"))
(define-ffi wcwidth (_fun _wchar -> _int))
but failed: > (wcwidth (char->integer #\a)) ; works
1
> (wcwidth (char->integer #\苹)) ; broken
-1
Is there a better way to do this, with minimal dependencies?

Not sure about the wcwidth
, but your original function using get-text-extent
returns 2 for “a” and 4 for “苹” when I run it on Windows. I would expect the result of that function to depend on the default font installed on the system that it runs on…

Does an equivalent C program work?

SamPh on the Discord helped me use wcwidth_l
instead, to explicitly provide a locale that supports utf–8, so that’s a slight improvement, but I don’t even know if wcwidth_l
will be available on windows (I tried to access wcwidth
through the ffi on windows and it didn’t work).

is contract-random-generate
seeded by random-seed
? if not, how can I seed it?

Yes, I think so.

This doesn’t have to depend on a drawing library but it’s probably hard not to

The question is fundamentally about fonts