Re: [racket-users] Unicode identifiers

2018-05-17 Thread N. Raghavendra
At 2018-05-17T11:11:26-04:00, Greg Hendershott wrote: > One gotcha, which I remember confusing myself with, early on: > > (define 'foo "foo") > '1 ;"foo" > '2 ;"foo" > > Huh? That's because 'foo is reader shorthand for (quote foo). So the > above is actually: > > (define (quote foo

Re: [racket-users] Unicode identifiers

2018-05-17 Thread Greg Hendershott
One of my favorite small things about Racket is that is permits almost anything to be an identifier -- allowing you to use whatever natural names you prefer. In addition to Unicode, identifiers can start with a number: (define 100-continue? "✓") In the rare case where an identifier wouldn't

Re: [racket-users] Unicode identifiers

2018-05-16 Thread N. Raghavendra
At 2018-05-16T07:32:43-07:00, Andrew Kent wrote: > #lang racket/base > > (require (for-syntax racket/base racket/string) > racket/require) > > (require (filtered-in > (λ (name) > (string-replace name "->" "→")) > racket)) > > (string→number "42") Thank you.

Re: [racket-users] Unicode identifiers

2018-05-16 Thread Alexander McLin
Would it be possible to adjust the readtable to replace "→" with "->" ? On Wednesday, May 16, 2018 at 10:32:43 AM UTC-4, Andrew Kent wrote: > > `racket/string` needs to be required _for syntax_ in order to work in the > suggested way (because it's bindings are needed at compile time). > > The f

Re: [racket-users] Unicode identifiers

2018-05-16 Thread Andrew Kent
`racket/string` needs to be required _for syntax_ in order to work in the suggested way (because it's bindings are needed at compile time). The following works for me in a module: ``` #lang racket/base (require (for-syntax racket/base racket/string) racket/require) (require (filtered-

Re: [racket-users] Unicode identifiers

2018-05-16 Thread N. Raghavendra
At 2018-05-16T09:12:18-04:00, Alex Knauth wrote: > Here is a `transform-right-arrow-in` definition that transforms -> > into →: > > #lang racket > (require racket/require > racket/require-syntax > (for-syntax syntax/parse)) > > (begin-for-syntax > ;; String -> String > (defin

Re: [racket-users] Unicode identifiers

2018-05-16 Thread N. Raghavendra
At 2018-05-16T12:37:47+02:00, Jens Axel Søgaard wrote: > (require (filtered-in >   (lambda (name) > (and (regexp-match? #rx"^[a-z-]+$" name) >  (regexp-replace #rx"-" (string-titlecase name) > ""))) >   racket/base)) Thank you fo

Re: [racket-users] Unicode identifiers

2018-05-16 Thread David Storrs
On Wed, May 16, 2018 at 6:37 AM, Jens Axel Søgaard wrote: > and it converts the names to “camel case.” > Why do you hurt me, Jens? You always seemed like such a nice person. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from

Re: [racket-users] Unicode identifiers

2018-05-16 Thread Alex Knauth
> On May 16, 2018, at 6:37 AM, Jens Axel Søgaard wrote: > > Alternative 1: Use filtered-in to require renamed versions. > > ( <>filtered-in > > proc-expr require-s

Re: [racket-users] Unicode identifiers

2018-05-16 Thread Jens Axel Søgaard
Alternative 1: Use filtered-in to require renamed versions. (filtered-in proc-expr require-spec) Applies an arbitrary transformation on the import names (as strings) o

[racket-users] Unicode identifiers

2018-05-15 Thread N. Raghavendra
I just found that > (define φoo→β=αρ "Foo→b=ar") > φoo→β=αρ "Foo→b=ar" >(call-with-output-file "/tmp/foo.txt" (λ (out) (display (xml-remove-markup) out)) #:exists 'replace) etc., work. That's nice. In general, is it possible to declare, e.g., '→' as equivalent to '->' in identifiers?