Re: [BUG] Eval sets incorrect runtime metainformation

2024-06-26 Thread Andy Wingo
Hello, On Tue 25 Jun 2024 17:07, Andrew Tropin writes: > (use-modules (system vm program) > (ice-9 eval-string)) > > (eval-string "(define (test-fn) 'hey)" > #:file "hello.scm" > #:line 1 > #:column 1 > #:compile? #f) > > (format #

RE: [BUG] Eval sets incorrect runtime metainformation

2024-06-26 Thread Maxime Devos
> (use-modules (system vm program) > (ice-9 eval-string)) > > (eval-string "(define (test-fn) 'hey)" > #:file "hello.scm" > #:line 1 > #:column 1 > #:compile? #f) > > (format #t "~a\n" (program-sources test-fn)) > ;; ((0 ice-9/eval.sc

RE: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Andrew Tropin
On 2024-06-25 13:27, Maxime Devos wrote: > >-Returns the number of characters in the given @var{string}. > +Returns the number of bytes in the given @var{string}. > > This is false. For example, (string-length "πŸ˜€") is 1, whereas in all > encodings I know of it is more than one byte. Also, R5RS

RE: [BUG] Eval sets incorrect runtime metainformation

2024-06-26 Thread Andrew Tropin
On 2024-06-26 11:36, Maxime Devos wrote: >>> (use-modules (system vm program) >>> (ice-9 eval-string)) >>> >>> (eval-string "(define (test-fn) 'hey)" >>> #:file "hello.scm" >>> #:line 1 >>> #:column 1 >>> #:compile? #f) >>> >>> (form

RE: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Maxime Devos
>> >-Returns the number of characters in the given @var{string}. >> +Returns the number of bytes in the given @var{string}. >> >> This is false. For example, (string-length "πŸ˜€") is 1, whereas in all >> encodings I know of it is >more than one byte. Also, R5RS says: [...] > >Maybe `the number o

Re: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread tomas
On Wed, Jun 26, 2024 at 01:46:28PM +0200, Maxime Devos wrote: > > >> >-Returns the number of characters in the given @var{string}. > >> +Returns the number of bytes in the given @var{string}. > >> > >> This is false. For example, (string-length "πŸ˜€") is 1, whereas in all > >> encodings I know o

RE: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Maxime Devos
>ISTR that "Unicode character" is actually synonymous the same than "Unicode code point" -- but the common meaning of "character" is more fuzzy. Perhaps it's wise to avoid that word when trying to be precise. My second point was that it is to late for that, unless you intend to rename procedures

Re: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Jean Abou Samra
Le mercredi 26 juin 2024 Γ  13:46 +0200, Maxime Devos a Γ©critΒ : > > > > Maybe `the number of codepoints` will work here. > > (string-length "πŸ‘¨β€πŸ­") ;; => 3 > > (string-length "é") ;; => 2>Β  > > The number of characters here is 1 in both cases. > > No, in Unicode (and Guile equates character=Unicod

RE: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Maxime Devos
>No; he wrote é, U+0065 LATIN SMALL LETTER E + U+0301 COMBINING ACUTE ACCENT, >which is two characters unlike Γ©, LATIN SMALL LETTER E WITH ACUTE. > >Likewise πŸ‘¨β€πŸ­ is U+1F468 MAN + U+200D ZERO WIDTH JOINER + U+1F3ED FACTORY. Right, I should have tested that instead of assuming it’s the pre-combined

Re: [PATCH 1/3] Make string-length documentation more correct

2024-06-26 Thread Damien Mattei
and how long for this one? π“„Ώπ“Ž’π“†‘π“‡‹π“…ƒπ“‰”π“‡Œπ“ƒ€π“†“ πŸ˜‚

Re: [BUG] Eval sets incorrect runtime metainformation

2024-06-26 Thread Andy Wingo
On Wed 26 Jun 2024 11:36, Maxime Devos writes: > IIRC, the question wasn’t about debugging in general, it was about > source locations in particular. Surely program-sources (or, in this > case, procedure-source maybe?) (why are the procedures in this family > even named program-whatever, this pre