« Return to Thread: Why Martin hates string interpolation (Was: Re: Formatting Questions Summary)

Re: Why Martin hates string interpolation (Was: Re: Formatting Questions Summary)

by Derek Chen-Becker-2 :: Rate this Message:

Reply to Author | View in Thread

Bill Venners wrote:

> Hi All,
>
> On Fri, May 29, 2009 at 1:33 PM, Robert Fischer
> <robert.fischer@...> wrote:
>> Someone could make a fine little side-business on selling "Scala" keyboards!
>>
> I wonder how hard it would be to reprogram one function key to the be
> the Unicode character for =>, another function key to be the Unicode
> character for <-, and still another function key the Unicode character
> for ->. That would make for a bit prettier code, and one could argue
> it would make for more "functional" programming. Sorry about that last
> one, but having some kind of downloadable file that would reprogram
> function keys to make scala programming quicker might be useful.

I'm on Ubuntu and I put together a small keyboard layout that extends US
basic:

partial alphanumeric_keys
xkb_symbols "scala" {

    name[Group1]= "USA - Scala";

    include "us(basic)"

   key <AB08>  { [     comma,     less,  leftarrow,   leftarrow ] };
   key <AB09>  { [    period,  greater, rightarrow,   rightarrow ] };
   // Double right arrow
   key <AE12>  { [     equal,     plus,  0x10021D2,   0x10021D2 ] };
};

This should generally work on any Linux system using XKB, although
configuration may be distro-specific. On Linux, you can paste the above
text at the end of /usr/share/X11/xkb/symbols/us, then for Ubuntu >=
8.10, edit /usr/share/X11/xkb/rules/evdev.xml and find "olpc2". Insert
the following XML after the </variant> tag for olpc2:

        <variant>
          <configItem>
            <name>scala</name>
            <description>Scala Layout</description>
          </configItem>
        </variant>


Now, if you open the keyboard preferences and add a layout, there should
be a new one under United States called "USA Scala Layout". Kinda crude
having to hack on these files, but it works.

Derek

 « Return to Thread: Why Martin hates string interpolation (Was: Re: Formatting Questions Summary)