Re: [racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Peter W A Wood
part._runtime-path%29 > > <https://docs.racket-lang.org/reference/Filesystem.html#%28part._runtime-path%29> > > -Philip > > > On Mon, Jul 27, 2020 at 9:38 PM Peter W A Wood <mailto:peterwaw...@gmail.com>> wrote: > I have a short racket program/script tha

[racket-users] Working out which directory the current code was loaded from?

2020-07-27 Thread Peter W A Wood
I have a short racket program/script that reads a file from the directory in which it is stored. The directory structure is something like this: a/ b/ c/ my-racket.rkt

Re: [racket-users] Are Regular Expression classes Unicode aware?

2020-07-11 Thread Peter W A Wood
Dear Ryan Thank you for both your full, complete and understandable explanation and a working solution which is more than sufficient for my needs. I created a very simple function based on the reg=exp that you suggested and tested it against a number of cases: #lang racket (require

Re: [racket-users] Are Regular Expression classes Unicode aware?

2020-07-10 Thread Peter W A Wood
o a base letter and a combining mark. You can get the > decomposed form by converting the string to "decomposed normal form" (NFD), > and the regexp above won't match that string. > > > (map char-general-category (string->list (string-normalize-nfd "é")))

[racket-users] Are Regular Expression classes Unicode aware?

2020-07-09 Thread Peter W A Wood
I was experimenting with regular expressions to try to emulate the Python isalpha() String method. Using a simple [a-zA-Z] character class worked for the English alphabet (ASCII characters): > (regexp-match? #px"^[a-zA-Z]+$" "hello") #t > (regexp-match? #px"^[a-zA-Z]+$" "h1llo") #f It then