Re: How do you feel about utf-8 in ruby code?
Gerald Bauer <[email protected]>
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <CAAxEZd8GOChWAfXPst4Efg2ZfWZphVhZgE8XW+Vtfcts7VJSdA@mail.gmail.com> |
Hello,
Good point of code points. I will add the code points to the documentation.
Note: For now the unicode names are auto-generated (no typing
needed) and used for pretty printing. Example:
```
#<Safe::Array‹Integer›:0x31c1f10 @ary=[]>
.#<Safe::Array‹Array‹Integer››:0x31c11c0
@ary=
[#<Safe::Array‹Integer›:0x31c1160 @ary=[100, 200]>,
#<Safe::Array‹Integer›:0x31c1130 @ary=[300]>]>
#<Safe::Array‹Array‹Integer››:0x31bb388
@ary=
[#<Safe::Array‹Integer›:0x31bb358 @ary=[100, 200]>,
#<Safe::Array‹Integer›:0x31bb328 @ary=[300]>]>
..#<Safe::Array‹Array‹Integer›×3›×3:0x31b8c58
@ary=
[#<Safe::Array‹Integer›×3:0x31b8bf8 @ary=[0, 0, 0]>,
#<Safe::Array‹Integer›×3:0x31b8bc8 @ary=[0, 0, 0]>,
#<Safe::Array‹Integer›×3:0x31b8b98 @ary=[0, 0, 0]>]>
#<Safe::Array‹Array‹Integer›×3›×3:0x31b8c58
@ary=
[#<Safe::Array‹Integer›×3:0x31b8bf8 @ary=[1, 2, 1]>,
#<Safe::Array‹Integer›×3:0x31b8bc8 @ary=[2, 0, 0]>,
#<Safe::Array‹Integer›×3:0x31b8b98 @ary=[0, 0, 0]>]>
```
Isn't ruby (with unicode) beautiful?
Happy coding with ruby (and unicode). Cheers. Prost.
PS: Note, the "magic" unicode names in the safestruct (safe data
structures) library are now documented in the section titled "Bonus:
Auto-Generated Unicode (UTF-8) Class Constants / Names for Pretty
Printing" [1].
[1] https://github.com/s6ruby/safestruct#bonus-auto-generated-unicode-utf-8-class-constants--names-for-pretty-printing
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>