Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Ruby strings

Name: Anonymous 2006-04-06 10:54

Do Ruby strings suck, or do they actually have support for multibyte characters and different encodings? Googling seems to suggest the former.

Name: Anonymous 2006-04-06 11:04

You can do some stuff to enable multibyte support I think.

Name: Anonymous 2006-04-06 16:43

They suck. It's one of Ruby's weak points.

You can do it, but it isn't as nice as, say, Python's support for unicode.

Name: Anonymous 2006-04-06 18:01

What is this ruby I keep hearing about? Is it worth learning? Is it used in industry? kthx

Name: Anonymous 2006-04-06 18:04

>>4
It's on the rise, and it is very nice. Go try it out. Someone else will point you to some nice guide, I read one in Engrish that was perfect for me, but alas I cannot find it.

Name: Anonymous 2006-04-06 18:04 (sage)

>>5
I forgot -- Ruby is really slow :-)

Name: Anonymous 2006-04-06 18:13

>>1
Uh oh, wait. Made by Japs and it doesn't have proper international support? PLEASE tell me its strings are Unicode (any of UTF-8, UTF-16, or UTF-32 if you must). I don't care if it doesn't have any support for other character sets, in fact it's even better if it doesn't, so people don't use the wrong character sets.

Name: Anonymous 2006-04-06 18:16

Ruby tutorial with comics!
http://poignantguide.net/ruby/

Name: Anonymous 2006-04-06 18:52

>>7
No unicode. It's one of the things slated for Ruby 2.0, which they're working on now. They're also working on a significant speed-bump.

Of course, when Ruby2 comes out is another question. It could be next month, or it could be in a couple years. :(

Name: Anonymous 2006-04-06 19:36

Why do they call them codeblocks? They seem just like lambda forms with side effects to me.

Name: Anonymous 2006-04-06 20:55

llo i cant belive poeple need side efects to do hings lll i am smug lisp weenise desi

Name: Anonymous 2006-04-06 21:03

>>11
I was just wondering why they use such a non-descriptive term as "code-block," which is conventionally used to mean pretty much anything. Why didn't they call them anonymous functions, or something that gives a better idea of what they're used for?

And I don't even know lisp.

Name: Anonymous 2006-04-06 21:25

anonymous function doesn't sound very OOP.  at least block implies something object-like.  it's really a Proc object as far as Ruby is concerned anyway.

Name: Anonymous 2006-04-06 22:02

>>12
It's a closure, not just an anonymous function. The reason they're called blocks (not "code-block" BTW) is because smalltalk called them blocks.

Name: Anonymous 2006-04-07 3:50

>>10
>>12
As a lisp weenie I thought it was weird at first. It's just a bit of syntax designed to be equivalent to lambda functions but easier to use in most cases. You just append them to the function call and it gets passed as an implicit argument. Once you get used to it it's actually quite nice. I'm usually against languages with syntax, but Ruby uses it quite elegantly.

Name: Anonymous 2006-04-07 4:13

>>9
Well then, no Ruby for me until they get the one and only proper character set support.

>>12
Don't bitch, "lambda" is an even worse name.

>>13
Yes, because OOP is a best-practice industry-standard business-oriented thing. Nevermind they are functions. Perhaps they'd be fine if they were exactly the same, but called anonymous methods belonging to the Anonymous static class.

Seriously, do you know what's the difference between a terrorist and an object methodologist? You can sometimes negotiate with the terrorist.

Name: Anonymous 2006-04-07 4:28

>>16
Java has made a lot of people so angry that any mention of "Object O SHI-" mades them become violent :( Someone should make Sun Microsystems pay for their crimes.

Name: Anonymous 2006-04-07 9:54

>>17
Exactly. Before a few months ago, all the OO languages I knew sucked, and after dealing with it in Java I got to hate it. Python's curing me though, but I still fume when I hear OO and Java in the same sentence, brings bad memories.

Name: Anonymous 2006-04-07 10:40

Java made me think I didn't love programming anymore. I almost became my worst enemy: an IT guy. Lisp healed me.

Name: Anonymous 2006-04-07 10:50

Even perl handles unicode

Name: Anonymous 2006-04-07 12:17

>>20
You know why? They've ran out of ./()%-=,;!"<@#~)':`[]+*&|>{}\ and they need to add more functionality, and Unicode can help with that. Think about the Hearts operation, the vertical ellipsis hack, the line drawing indentation or the Euro formatting! We could even make it so that functions to convert between international character sets are implemented by using country currencies, so if you want to convert between US-ASCII and Shift_JIS the function is a dollar and a yen symbols. The data would actually go between the symbols, like €stuff$, because it's cooler, and the conversion is done in place, but $_ is binded to the results and we then create a dollar middledot special variable to retrieve the number of changes. How about it?

Name: Anonymous 2006-04-07 13:06

>>6
Ruby is a language, a concept you moron, it can't be slow!

Name: Anonymous 2006-04-07 13:07

>>22
The interpreter, ruby.

Name: Anonymous 2006-04-07 13:08

Name: Anonymous 2006-04-07 14:29

>>21
I loled.

Name: Anonymous 2006-04-07 18:24

>>20
I found Perl's unicode support half-baked. The main problem was that unicode works very poorly with regex in Perl. I spent a few hours bashing my head, wondering why rather simple regular expressions didn't do what they were supposed to.

In the end I had to use Python, which actually worked. I don't like Python much, but at least when it says "supports unicode", it fucking supports it.

Name: Anonymous 2010-05-17 1:08

lololololololol

Name: Anonymous 2010-05-17 1:11

>>26
your failure to RTFM is not a valid reason to bash perl's unicode support.

Name: Anonymous 2010-05-17 11:11

Ruby 1.9 supports different encodings as well as multibyte characters just fine.

Name: Anonymous 2010-05-17 11:32

>>26
Python
unicode

Enjoy your Error: can't decode ordinal in position X: ... all the fucking time goddamn just let me write those characters to a file

Name: Anonymous 2010-05-17 11:41

Why...?
Why can't they just assume UTF-8 (which is correct in 99% of cases) unless told otherwise? Why do I need to "encode" and "decode" everything?
It's fucking 2010.

Name: Anonymous 2010-05-17 11:43

UNICODE CAN GO TO HELL AND ALL WHO USE IT WITH IT!

HAIL ASCII!

Name: Anonymous 2010-05-17 11:48

You must all not be using Python 3, just like me.

Name: Anonymous 2010-05-17 12:05

>>33
It's scary to move on...

Name: Anonymous 2010-05-17 13:33

>>31
Because UTF-8 is slow.

Name: Anonymous 2010-05-17 13:35

>>30
Enjoy trying to use functions without understanding what they do. Of course you're going to run into trouble.

Name: Anonymous 2010-05-17 13:55

>>35
But nowadays everything is UTF-8 so it's quite reasonable to use it as a default encoding instead of plain old ASCII. Of course, internally it can just convert everything to UTF-32 (and many languages/implementations do) and be done with it but it shouldn't make me encode and decode everything when I'm using THE STANDARD.
At the very least it should give me the ability to define a default IO encoding from which everything should be converted to/from.

Name: Anonymous 2010-05-17 14:02

>>37
But nowadays everything is UTF-8
Because the only thing strings are used for is representing natural language, right? Fuck you.

Name: Anonymous 2010-05-17 14:50

>>38
Yes, that's all you supposed to store in a character string.

Name: Anonymous 2010-05-17 15:02

if everyone would just use English, like they are supposed to, we would support for faggot character sets

Name: Anonymous 2010-05-17 15:05

WOULDN'T NEED support for...

Name: Anonymous 2010-05-17 15:21

If everyone would just use Binary, like they are supposed to, we would support for character sets

Name: Anonymous 2010-05-17 15:56

if everyone would just use English
Why would we want that? English sucks, and I say that as a native English speaker. Unfortunately, so does every other natural and non-natural language. One day we will have a sane language....one day....

Name: Anonymous 2010-05-17 16:11

>>43
Lojban is calling you.

Name: Anonymous 2010-05-17 17:55

>>40
English itself uses plenty of characters outside of ASCII.

Name: Anonymous 2010-05-17 20:32

>>43
http://www.lojban.org/tiki/Lojban Is calling for you. Join us.

Name: Anonymous 2010-05-17 23:44

Lojban has been built over five decades by dozens of workers and hundreds of supporters.
Hundreds of supporters? Thats as many people as the student body of a medium sized high-school!

Don't change these.
Name: Email:
Entire Thread Thread List