I’ve been thinking about doing Ruby bindings to Elvin
(http://elvin.dstc.edu.au/projects/elvind/). Before I reinvent the wheel,
is or has anyone out there already done this, or started on it?
Thanks,
Kirk Haines
I’ve been thinking about doing Ruby bindings to Elvin
(http://elvin.dstc.edu.au/projects/elvind/). Before I reinvent the wheel,
is or has anyone out there already done this, or started on it?
Thanks,
Kirk Haines
There’s an interesting little library on RAA that will send text through
the AltaVista translation website and then parse out all of the HTML that
the site returns to get back just the translated text.
This is a neat toy, but is fragile. Does anyone know if any of the online
machine translation services offer any sort of web accessible API or web
interface that does not wrap the returned text in gunk that must be
trimmed away to get to the transated text?
My suspicion is that the answer is, “No.”, but I have been wrong before.

Thanks,
Kirk Haines
Patrick Bennett wrote:
FWIW, I have yet to hear a good reason for hard tabs.
As soon as a
Well, one good reason is that if you like your tab stops every 8 spaces, and
I like mine every 2 spaces, then I can read your sources without too much
irritation.
I find, in practice, that spaces are better than tabs, but only if you're
(a) not sharing sources, (b) all have the same aesthetics (or can force
your aesthetics on everybody else >-), or (c) have a really good
reformatter built into your editor. Actually, (c) is nice to have whether
or not you're using spaces.
--
### SER
### Deutsch|Esperanto|Francaise|Linux|XML|Java|Ruby|Aikido
### http://www.germane-software.com/~ser jabber.com:ser ICQ:83578737
### GPG: http://www.germane-software.com/~ser/Security/ser_public.gpg
..
In Message-Id: 20040224111638.GA23593@freeze.org
Jim Freeze jim@freeze.org writes:
Speaking of tabs, I have a colleague that uses emacs. Using
ruby-mode.el, indents two spaces, unless he tabs
4 times. Then the 8 spaces are converted to a hard tab.Is there a way to prevent this from happening? Particularly, is
there a way for ruby-mode.el to do this so he does not have to
permanently change his tab setting in emacs.
Add the following to your colleague’s .emacs:
(add-hook 'ruby-mode-hook
#'(lambda () (setq indent-tabs-mode nil)))
Or just
(setq-default indent-tabs-mode nil)
for any language modes.
–
kjana@dm4lab.to February 24, 2004
Every body’s business is nobody’s business.
“Jim Freeze” jim@freeze.org schrieb im Newsbeitrag
news:20040224111638.GA23593@freeze.org…
FWIW, I have yet to hear a good reason for hard tabs.
As soon as
a
single space is used anywhere on a line after tabs, the tabs mean
nothing and will cause the indentation to be mismatched on someone
else’s system. With spaces, the indentation is always correct.Speaking of tabs, I have a colleague that uses emacs. Using
ruby-mode.el, indents two spaces, unless he tabs
4 times. Then the 8 spaces are converted to a hard tab.Is there a way to prevent this from happening? Particularly, is
there a way for ruby-mode.el to do this so he does not have to
permanently change his tab setting in emacs.
I’m not an emacs expert and the only solution that I would come up with is
to write a hook that sets indent-tabs-mode to nil when entering ruby mode.
Regards
robert
On Tuesday, 24 February 2004 at 12:32:46 +0900, Patrick Bennett wrote:
Thanks
–
"I went to a job interview the other day, the guy asked me if I had any
questions , I said yes, just one, if you’re in a car traveling at the
speed of light and you turn your headlights on, does anything happen?He said he couldn’t answer that, I told him sorry, but I couldn’t work
for him then.
– Steven Wright
Kirk Haines wrote:
Tabs are also faster for me. It’s a tangible difference when I am writing
a lot of code, and when I am really into a coding groove it’s always my
fingers that are the limiting factor to how fast I can produce the code,
so every little bit helps.
In emacs ruby-mode, hitting ‘tab’ means to indent the code by the
appropriate amount. For me, it always does this using spaces.
Spaces mixed with tabs can mess the indentation up (though not
necessarily), but I don’t find that to be a significant factor, for me.
If there are spaces mixed with tabs, I’ve been sloppy, and I fix it. It
rarely affects me adversely, though, whereas the freedom to adjust
indentation through editor settings and the speed increase that I get from
it helps me. If I had a neural interface that reduced the bottleneck that
my fingers impose on me, tabs would lose much of their advantage over
spaces, for me.
Again, with emacs, if you want to change your indentation level, just
change your ‘basic-offset’ setting, select the whole buffer and run
‘indent-region’, it will reformat the entire buffer (or just the
selected part) according to your new setting.
As others have said, the problem isn’t with tabs or spaces, it’s with
tabs AND spaces. If you mix them, you cause problems. The trouble
is, it’s really easy to mix them. Take the following code snippet:
print("This is the start of a very long string that " +
“I’m continuing on the next line.”)
Most people that I know would want it lined up as above, so that the
start of the second string lines up with the start of the first one,
however that’s six characters in. What happens when both lines are
indented, as in:
if (print_string)
print("This is the start of a very long string that " +
“I’m continuing on the next line.”)
end
If you’re using tabs to indent, the second line should contain 1 tab,
followed by 6 spaces. But what if your editor thinks that a tab is 4
spaces? I would bet that under most circumstances it would insert 2
tabs and 2 spaces.
Anyhow, some good reading on this issue, with some vi/emacs methods of
dealing with it can be found on Jamie Zawinski’s site:
http://www.jwz.org/doc/tabs-vs-spaces.html
Ben
I use vim. I indent and unindent with tab and backspace. I only use spaces.
Vim is smart. Any editor which isn’t this smart doesn’t deserve to be used
for coding ![]()
-austin
On Tue, 24 Feb 2004 13:38:09 +0900, Kirk Haines wrote:
Tabs are also faster for me. It’s a tangible difference when I am
writing a lot of code, and when I am really into a coding groove it’s
always my fingers that are the limiting factor to how fast I can produce
the code, so every little bit helps.
–
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2004.02.25
* 12.05.32
Hi !
There’s an interesting little library on RAA that will send text through
the AltaVista translation website and then parse out all of the HTML that
the site returns to get back just the translated text.
You can also access babelfish via a webservice… Done that a while ago and
it worked quite well…
Regards,
Michael
in the soap4r distribituion there was a SOAP client for babelfish
service
il Thu, 26 Feb 2004 03:07:57 +0900, Kirk Haines khaines@enigo.com ha scritto::
There’s an interesting little library on RAA that will send text through
the AltaVista translation website and then parse out all of the HTML that
the site returns to get back just the translated text.This is a neat toy, but is fragile. Does anyone know if any of the online
machine translation services offer any sort of web accessible API or web
interface that does not wrap the returned text in gunk that must be
trimmed away to get to the transated text?
Kirk Haines wrote:
The trick here, though, is that Ruby has a style: two-space indentation, no
tabs. If you write a library that you want included in the standard library,
you need to conform to the style there.And I agree with you here. If I were writing code that was going to be in
the standard library, I’d go through the pain of conforming my style to
the described “Ruby” style so that it fits in with the rest of the code.When writing the code that keeps my family fed, though, it is far too hard
to make sure my Perl adhere’s the the described Perl community’s style,
and my Java to the described Java community’s style, and my Ruby to Ruby
style, and my Bash scripts to yet a different style, and my C to…
It’s too many completely arbitrary styles. Far better for me to use the
style that fits best with the way I work and the way that I read code and
to do so consistently across everything that I have to produce and to
maintain.
That seems like a real world use of case to me. Some of the
comments here tend to be a bit zealot’ish. I find your approach not only acceptable but preferred. Not that you are, but I would not sweat it too much.
On Thu, 26 Feb 2004, Austin Ziegler wrote:
If anything that I write ever becomes interesting enough to other people
that I have people actually using it and looking at the code, then I will
find it worthwhile, for those items, to make a pass through them
converting the abhorred camelCase to snake_case and tabs to spaces and
everything else necessary to fit into the described Ruby style.Thanks for the discussion. It’s been fun.
Kirk Haines
"Sean Russell" <ser@germane-software.com> schrieb im Newsbeitrag
news:cluo1c.tku.ln@0.0.0.0...
Patrick Bennett wrote:
> FWIW, I have yet to hear a good reason for hard tabs.
As soon as a
Well, one good reason is that if you like your tab stops every 8 spaces,
and
I like mine every 2 spaces, then I can read your sources without too much
irritation.I find, in practice, that spaces are better than tabs, but only if you're
(a) not sharing sources,
That's funny: sharing is the exact reason why I *like* spaces for
indentation. They ensure that the code looks the same regardless of local
tab settings. I consider this an advantage because it makes sure that
comment indentations etc. look the way they were intended (no pun intended).
I prefer to see code indented the way the author meant to do it over
seeing a mess of indentations caused by mixed usage of tabs and spaces or
whatever editor pecularities.
(b) all have the same aesthetics (or can force
your aesthetics on everybody else >-), or (c) have a really good
reformatter built into your editor. Actually, (c) is nice to have whether
or not you're using spaces.
Sure.
Regards
robert
I dont know why everyone makes such a big deal about tabs vs spaces. If
your editor isnt a piece of crap, switching between tabs and spaces, and
changing the number of spaces, should be no problem as long as the file is
written consistently. One of my colleagues uses hard-tabs exclusively, and
I use two space soft tabs. Every time he sends me a file, I run a command
in vim, and *POOF* - it uses two space soft tabs. I send him the file
back, and he uses a perl script he wrote to convert it back.
I only have a problem when somebody uses spaces and tabs interchangeably
in the same file. Even then, its not that much trouble to fix.
On Thu, 10 Jun 2004 15:52:47 +0000, Sean Russell wrote:
Patrick Bennett wrote:
FWIW, I have yet to hear a good reason for hard tabs.
As soon as a
Well, one good reason is that if you like your tab stops every 8 spaces, and
I like mine every 2 spaces, then I can read your sources without too much
irritation.I find, in practice, that spaces are better than tabs, but only if you're
(a) not sharing sources, (b) all have the same aesthetics (or can force
your aesthetics on everybody else >-), or (c) have a really good
reformatter built into your editor. Actually, (c) is nice to have whether
or not you're using spaces.
Hi,
At Tue, 24 Feb 2004 21:40:22 +0900,
YANAGAWA Kazuhisa wrote in [ruby-talk:93555]:
Speaking of tabs, I have a colleague that uses emacs. Using
ruby-mode.el, indents two spaces, unless he tabs
4 times. Then the 8 spaces are converted to a hard tab.Is there a way to prevent this from happening? Particularly, is
there a way for ruby-mode.el to do this so he does not have to
permanently change his tab setting in emacs.Add the following to your colleague’s .emacs:
(add-hook 'ruby-mode-hook #'(lambda () (setq indent-tabs-mode nil)))
Since 2003/02/17, ruby-indent-tabs-mode is used for that
purpose, and defaulted to nil.
–
Nobu Nakada
Thanks
On Tuesday, 24 February 2004 at 21:40:22 +0900, YANAGAWA Kazuhisa wrote:
In Message-Id: 20040224111638.GA23593@freeze.org
Add the following to your colleague’s .emacs:
(add-hook 'ruby-mode-hook #'(lambda () (setq indent-tabs-mode nil)))Or just
(setq-default indent-tabs-mode nil)for any language modes.
–
Jim Freeze
Hi,
From: “gabriele renzi” surrender_it@rc1.vip.ukl.yahoo.com
Sent: Thursday, February 26, 2004 6:19 AM
There’s an interesting little library on RAA that will send text through
the AltaVista translation website and then parse out all of the HTML that
the site returns to get back just the translated text.This is a neat toy, but is fragile. Does anyone know if any of the online
machine translation services offer any sort of web accessible API or web
interface that does not wrap the returned text in gunk that must be
trimmed away to get to the transated text?in the soap4r distribituion there was a SOAP client for babelfish
service
In Ruby/1.8.1, too.
0$ ruby sample/soap/babelfish.rb “Hello, World” en_fr
“This service is currently disabled.”
Doh! I don’t know the service status.
Searching http://www.xmethods.net/ve2/Directory.po with “babel”…
A “babel fish” that speaks Swedish Chefish, Jive, Drawl, Eleet
and other dialects"
http://ww6.borland.com/webservices/BorlandBabel/BorlandBabel.exe/wsdl/IBorlandBabel
It must not be the one, though…
0$ ruby -rsoap/wsdlDriver -e ‘puts
SOAP::WSDLDriverFactory.new(“http://ww6.borland.com/webservices/BorlandBabel/BorlandBabel.exe/wsdl/IBorlandBabel”).create_driver.Sup
portedLanguages’ Bleep
Censor
Chef
Drawl
Eleet
EuroEnglish
Fudd
Funetak
Jive
Moo
Valspeak
0$ ruby -rsoap/wsdlDriver -e ‘puts
SOAP::WSDLDriverFactory.new(“http://ww6.borland.com/webservices/BorlandBabel/BorlandBabel.exe/wsdl/IBorlandBabel”).create_driver.Bab
elFish(“Fudd”, “Hello, world!”)’
Hewwo, wowwd!
Gee.
Regards,
// NaHi
Changing tab<->spaces in a file can cause problems with your CVS environment.
You could tell CVS to ignore the white space, but then you
can't check the white space that is really important.
I shudder at the thought. This is bordering on, ...well when
I get a file from my friend, I reformat it to look like I
want it to look like, changing indentation style, variable
and method names.... Where does it stop?
On Saturday, 12 June 2004 at 14:28:40 +0900, Ryan Paul wrote:
On Thu, 10 Jun 2004 15:52:47 +0000, Sean Russell wrote:
> Patrick Bennett wrote:
>
I dont know why everyone makes such a big deal about tabs vs spaces. If
your editor isnt a piece of crap, switching between tabs and spaces, and
changing the number of spaces, should be no problem as long as the file is
written consistently. One of my colleagues uses hard-tabs exclusively, and
I use two space soft tabs. Every time he sends me a file, I run a command
in vim, and *POOF* - it uses two space soft tabs. I send him the file
back, and he uses a perl script he wrote to convert it back.
--
Jim Freeze
ASHes to ASHes, DOS to DOS.
Changing tab<->spaces in a file can cause problems with your CVS environment.
You could tell CVS to ignore the white space, but then you
can't check the white space that is really important.
I understand your argument about CVS. I've never used it, so i've never
had issues like that. If I had to, I would pick a particular style to use
for cvs, and just convert to that style before committing. I'd probably
write a shell script to automate it.
I shudder at the thought. This is bordering on, ...well when
I get a file from my friend, I reformat it to look like I
want it to look like, changing indentation style, variable
and method names.... Where does it stop?
Why should it stop? As long as it still compiles/executes, and we can
communicate intelligently about the content, what difference does it make
how we change it while we work on it? I'd take it a step further, if I
could. We should all have our own personal syntaxes and make parsers that
generate from our code to/from a common format - or perhaps have a
database that contains the code (I think the original dylan
implementation worked that way) and have tools that generate code in our
own personal syntaxes from the database, and vice-versa. Seriously, what
is wrong with it? Someday, Parrot might facilitate something like that.
--SegPhault
Hi --
On Sat, 12 Jun 2004, Ryan Paul wrote:
> Changing tab<->spaces in a file can cause problems with your CVS environment.
> You could tell CVS to ignore the white space, but then you
> can't check the white space that is really important.I understand your argument about CVS. I've never used it, so i've never
had issues like that. If I had to, I would pick a particular style to use
for cvs, and just convert to that style before committing. I'd probably
write a shell script to automate it.> I shudder at the thought. This is bordering on, ...well when
> I get a file from my friend, I reformat it to look like I
> want it to look like, changing indentation style, variable
> and method names.... Where does it stop?Why should it stop? As long as it still compiles/executes, and we can
communicate intelligently about the content, what difference does it make
how we change it while we work on it? I'd take it a step further, if I
could. We should all have our own personal syntaxes and make parsers that
generate from our code to/from a common format - or perhaps have a
database that contains the code (I think the original dylan
implementation worked that way) and have tools that generate code in our
own personal syntaxes from the database, and vice-versa. Seriously, what
is wrong with it? Someday, Parrot might facilitate something like that.
One thing that's wrong with it is that I do not consider myself (or
the majority of other people) coming up with as nice a syntax as Matz
has. Seriously -- didn't we all start using Ruby in large part
because we thought Ruby syntax and visual style were wonderful? ![]()
David
--
David A. Black
dblack@wobblini.net
I'd take it a step further, if I
could. We should all have our own personal syntaxes and make parsers that
generate from our code to/from a common format - or perhaps have a
database that contains the code (I think the original dylan
implementation worked that way) and have tools that generate code in our
own personal syntaxes from the database, and vice-versa. Seriously, what
is wrong with it? Someday, Parrot might facilitate something like
that.
One thing that's wrong with it is that I do not consider myself (or the
majority of other people) coming up with as nice a syntax as Matz has.
Seriously -- didn't we all start using Ruby in large part because we
thought Ruby syntax and visual style were wonderful?
I like many aspects of ruby's syntax, but there are MANY aspects that I
would change. I dont like having to use the 'end' keyword to terminate
classes and functions for instance. I do really like ruby's block concept
tho, and like being able to choose between { } and do end. Syntax
aesthetics are somewhat specific to the individual. I like things a
certain way, and I wouldn't want to deny someone else the ability to see
it the way they want to.
Furthermore, there are practical advantages to having completely mutable
syntax: one could easily construct elegant domain specific languages for
any task, and model the syntax in a way that is ideal for that task. In a
way, we already do that in some cases - using YAML for instance, to
describe large lists/hashes is significantly more practical and time
effecient than doing the same thing in pure ruby. That doesnt mean that
ruby has bad array/hash syntax, it just means that for certain types of
tasks it makes more sense to use a different syntax.
Ultimately, I think most seasoned programmers know what they like and dont
like as far as syntax goes, and almost all of us are capable of devising
our own syntaxes - its making the parsers and interpreters that we dont
want to bother with.
I have an interest in language preprocessors, and syntax extension
mechanisms. I'd like to see Right have something along the same lines as
camlp4, a preprocessing engine with a standard mechanism that facilitates
construction of arbitrary syntactic extensions.
--SegPhault
Hello Ryan,
I like many aspects of ruby's syntax, but there are MANY aspects that I
would change. I dont like having to use the 'end' keyword to terminate
classes and functions for instance. I do really like ruby's block concept
tho, and like being able to choose between { } and do end. Syntax
aesthetics are somewhat specific to the individual. I like things a
certain way, and I wouldn't want to deny someone else the ability to see
it the way they want to.
I would vote for extending the end and enforce a "end class", "end
def", or "end module". This would make the syntax much more readable
and this is what is most important in the long term. I would even
forbid 'if' statements without a 'then'.
Overloading the '{' to do more things then know is IMO not really a good
idea.
--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's