Japanese Heritage of Ruby: useful by-product?

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

After reading :


(“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 )

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 …

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams
[email protected] 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):

(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

2008/8/28 Martin DeMello [email protected]:

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams
[email protected] 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):

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

#!/usr/bin/env ruby -Ku

alias ë proc

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

-greg

On Fri, Aug 29, 2008 at 5:46 AM, John Pritchard-williams
[email protected] 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: ]

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.

2008/8/28 Martin DeMello [email protected]:

On Thu, Aug 28, 2008 at 2:46 PM, John Pritchard-williams
[email protected] 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.

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

martin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs