Japanese Heritage of Ruby: useful by-product?

Apologies if this is in the wrong forum, I just thought it was
interesting....

After reading :

http://www.oreillynet.com/ruby/blog/2008/05/is_qwerty_harming_language_des.html
("Is QWERTY harming language design?"), I thought maybe Japanese Kanji
are actually useful in programming - even in the West.....they can be
used to reduce down method names for instance....

The only 'drawback' I found was you cannot declare classes this way,
without putting in a leading capital Roman letter....but for methods,
seems to work great !

class A水

        def 飲
                puts "You drank the water.Mizu o nomimashita..."
        end
end

water=A水.new
water.飲

(To run on ruby 1.8.x, need to : ruby -Ku <program file>)

Just thought it might be a nice way (or an absolute nightmare for
code-maintenance, depending on how you see these things!) to reduce code
- kinda of like using icons....I guess the glaring problem for
Westerners is actually getting the characters in there in the first
place [I used Babel fish...:wink: ]

Mmh...maybe Greek character 'Lambda' could be useful here as
well....better than mutating '->'....:slight_smile:

Or North,South,East,West arrows for games I see people are writing ...

···

--
Posted via http://www.ruby-forum.com/.

PLT Scheme lets you use "λ" instead of "lambda" in your code, e.g.
(from the distribution):

(define (smallest? can o1 o2 o3)
    (and can
         (andmap (λ (x) (< can x))
                 (filter (λ (x) x)
                         (list o1 o2 o3)))))

It was a bit disconcerting at first but now that I've gotten used to
it I find it makes things more readable.

martin

···

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams <monojohnny@googlemail.com> wrote:

Mmh...maybe Greek character 'Lambda' could be useful here as
well....better than mutating '->'....:slight_smile:

I think the glaring problem for Westerners would be actually learning
the kanji themselves. I use GNU/Linux and have SCIM installed, so
writing stuff like 外国人のキーボードは漢字を書く事が出来ます is not at all difficult.
Windows has an equally simple input method as well.

···

On Fri, Aug 29, 2008 at 5:46 AM, John Pritchard-williams <monojohnny@googlemail.com> wrote:

- kinda of like using icons....I guess the glaring problem for
Westerners is actually getting the characters in there in the first
place [I used Babel fish...:wink: ]

--
普通じゃないのが当然なら答える私は何ができる?
普通でも普通じゃなくて感じるまま感じることだけをするよ!
http://stormwyrm.blogspot.com

Also see http://www.perlmonks.org/?node_id=462246

martin

···

2008/8/28 Martin DeMello <martindemello@gmail.com>:

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams > <monojohnny@googlemail.com> wrote:

Mmh...maybe Greek character 'Lambda' could be useful here as
well....better than mutating '->'....:slight_smile:

PLT Scheme lets you use "λ" instead of "lambda" in your code, e.g.

I saw this originally from Dan Berger, but so can Ruby :slight_smile:

#!/usr/bin/env ruby -Ku

alias λ proc

doubler = λ { |x| x*2 }
p doubler[5] #=> 10

-greg

···

2008/8/28 Martin DeMello <martindemello@gmail.com>:

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams > <monojohnny@googlemail.com> wrote:

Mmh...maybe Greek character 'Lambda' could be useful here as
well....better than mutating '->'....:slight_smile:

PLT Scheme lets you use "λ" instead of "lambda" in your code, e.g.
(from the distribution):

--
Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
stuff at: http://metametta.blogspot.com