rostislav.svoboda
2021-5-25 10:37:36

Oho! Really nice stuff there!


arthertz
2021-5-25 16:32:51

hazel!!! amazing


arthertz
2021-5-25 16:35:04

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


rokitna
2021-5-25 18:52:17

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.


rokitna
2021-5-25 18:55:04

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


asumu
2021-5-25 19:53:24

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.


sschwarzer
2021-5-25 21:38:35

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.)


sschwarzer
2021-5-25 21:40:53

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”.


sschwarzer
2021-5-25 21:42:09

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


alexknauth
2021-5-25 22:06:23

I have this function: ;; string-width : String -&gt; 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: &gt; (string-width "a") 1 &gt; (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 -&gt; _int)) but failed: &gt; (wcwidth (char-&gt;integer #\a)) ; works 1 &gt; (wcwidth (char-&gt;integer #\苹)) ; broken -1 Is there a better way to do this, with minimal dependencies?


alexharsanyi
2021-5-25 22:31:23

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…


capfredf
2021-5-25 22:32:08

Does an equivalent C program work?


alexknauth
2021-5-25 23:02:51

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).


hazel
2021-5-25 23:39:09

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


samth
2021-5-26 00:17:06

Yes, I think so.


samth
2021-5-26 00:25:38

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


samth
2021-5-26 00:25:50

The question is fundamentally about fonts