[#83322] Saving and restoring with YAML — Ben Giddings <bg-rubytalk@...>
Hi all,
Ben Giddings wrote:
Ok, silly question.
[#83328] tcltklib and not init'ing tk — aakhter@... (Aamer Akhter)
Hello,
[#83329] Ruby 1.8.0 rpm? — Hal Fulton <hal9000@...>
I want to install on a box where I don't have root access.
[#83337] Include CONFIG::Config['rubydocdir'] in rbconfig.rb — Gavin Sinclair <gsinclair@...>
Hi folks,
Hi,
[#83391] mixing in class methods — "Mark J. Reed" <markjreed@...>
Okay, probably a dumb question, but: is there any way to define
On Thu, 2 Oct 2003 06:02:32 +0900
On Thursday, October 2, 2003, 7:08:00 AM, Ryan wrote:
On Thu, Oct 02, 2003 at 07:37:25AM +0900, Gavin Sinclair wrote:
> On Thu, Oct 02, 2003 at 07:37:25AM +0900, Gavin Sinclair wrote:
On Thu, 2 Oct 2003, Gavin Sinclair wrote:
>> It sometimes makes me wonder why Ruby differentiates between instance
Hi --
The assymetry between class/instance variables and class/instance
>>>>> "M" == Mark J Reed <markjreed@mail.com> writes:
[#83408] Getting a list of the files in a directory — revision17@... (Revision17)
Hi, I'm just starting out with ruby and I'm writing a script to rename
[#83411] Absolute class name? — "Mark J. Reed" <markjreed@...>
If I do
Hi,
MJR = me
>>>>> "M" == Mark J Reed <markjreed@mail.com> writes:
On Thu, Oct 02, 2003 at 11:11:59PM +0900, ts wrote:
On Thu, Oct 02, 2003 at 02:20:07PM +0000, Mark J. Reed wrote:
[#83413] I AWAIT YOUR URGENT RESPONSE — PETERS UJANI <peterujani@...>
Dear Sir,
[#83416] C or C++? — "Joe Cheng" <code@...>
I'd like to start writing Ruby extensions. Does it make a difference
The biggest problem i have with Ruby is the sleepness
On Thu, 2 Oct 2003, paul vudmaska wrote:
>>--------
Hi --
I think it would be wonderful if Ruby could handle XML somewhat how Flash
On Fri, 3 Oct 2003, Zach Dennis wrote:
[#83470] Re: xml in Ruby — paul vudmaska <paul_vudmaska@...>
>>>
paul vudmaska wrote:
>>------------
paul vudmaska wrote:
[#83481] newbie question: function overloading — Dimitrios Galanakis <galanaki@...>
I need to define a method that performs differently when operated on objects
On Fri, 3 Oct 2003, Dimitrios Galanakis wrote:
[#83520] Account Verification — "eBay SafeHarbor" <noreply@...>
[#83533] FreeRide — Carl Youngblood <carl@...>
Is it just my faulty perception or does the momentum behind FreeRIDE
I presented FreeRIDE as OSCON in July, but have not done much on it
[#83551] xml + ruby — paul vudmaska <paul_vudmaska@...>
>>---------
On Fri, 3 Oct 2003 16:11:46 +0900, paul vudmaska wrote:
Zach Dennis wrote:
James,
On Friday 03 October 2003 02:20 pm, paul vudmaska wrote:
[#83554] hash of hashes — Paul Argentoff <argentoff@...>
Hi all.
On Friday 03 October 2003 14:04, Paul Argentoff wrote:
Paul Argentoff wrote:
[#83608] webrick, threads, and i/o — "Ara.T.Howard" <ahoward@...>
[#83627] Ruby/Extensions 0.2.0 — Gavin Sinclair <gsinclair@...>
Hi -talk,
[#83665] Question about amrita and XHTML/CSS — Carl Youngblood <carl@...>
I've been looking into amrita for my ruby web development, but I am
[#83671] Stop Immigration — "Vanguard News Network " <vanguardnn@...>
Stop Immigration
[#83675] fox-tool - interactive gui builder for fxruby — henon <user@...>
hi fellows,
il Sun, 05 Oct 2003 16:17:16 GMT, henon <user@example.net> ha
gabriele renzi wrote:
Hi.
[#83727] map/collect iterating over multiple arrays/arguments — zoranlazarevic@... (Zoran Lazarevic)
Can I iterate over multiple arrays/collections?
[#83730] Re: Enumerable#inject is surprising me... — "Weirich, James" <James.Weirich@...>
> Does it surprise you?
Hi,
Hi,
Hi --
On Thu, 9 Oct 2003 dblack@superlink.net wrote:
>>>>> "d" == dblack <dblack@superlink.net> writes:
[#83741] Thread + fork warning — Ariff Abdullah <skywizard@...>
# ruby -e 'a = Thread.new { fork {} }; a.join'
[#83745] Re: Parsing challenge... — "Useko Netsumi" <usenets@...>
this script failed if any of the cell is blank/no-value,
[#83756] GC and the stack — "Thomas Sondergaard" <thomas@...>
Hello,
[#83758] usage of Regexp::EXTENDED — "Simon Strandgaard" <none@...>
How does it work ?
On Wed, 08 Oct 2003 21:58:42 +0900, Jim Weirich wrote:
[#83771] Re: GC and the stack — "Weirich, James" <James.Weirich@...>
> Okay. What if, in an extension, I have an integer on the
[#83783] shorthand notation for multiline in regexps? — Carl Youngblood <carl@...>
Is there a way to declare a multiline or ignorecase regexp without using
[#83795] Standard Queue Implementation and Thread Safety — Pete Kazmier <pete-temp-ruby-usenet-10082003@...>
First the disclaimer: I'm a newbie to ruby :-)
[#83801] Extension Language for a Text Editor — Nikolai Weibull <ruby-talk@...>
OK. So I'm going to write a text editor for my masters' thesis. The
You may want to look at the VIM's use of Ruby for writing extensions.
On Thu, 9 Oct 2003 05:06:32 +0900
* Ryan Pavlik <rpav@mephle.com> [Oct, 08 2003 22:30]:
On Thu, 9 Oct 2003 06:09:29 +0900
* Ryan Pavlik <rpav@mephle.com> [Oct, 09 2003 09:10]:
On Fri, 10 Oct 2003 02:36:25 +0900
* Ryan Pavlik <rpav@mephle.com> [Oct, 10 2003 16:49]:
On Oct 11, Nikolai Weibull wrote:
* Brett H. Williams <brett_williams@agilent.com> [Oct, 10 2003 20:50]:
On Wed, 08 Oct 2003 22:39:13 +0000, gabriele renzi wrote:
[#83802] Ruby Patriotism: Python+XML v. Ruby+YAML — why the lucky stiff <ruby-talk@...>
We've got a good old-fashioned derby going on in blogoland. Perhaps
Has anyone benchmarked Python+YAML? You should account for all the variables.
[#83822] TUI library — "Imobach =?iso-8859-15?q?Gonz=E1lez=20Sosa?=" <imobachgs@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#83843] case where regex range should raise — "Simon Strandgaard" <none@...>
irb(main):001:0> re = /bx{,2}c/
[#83850] Antwort: Re: SEPARATOR doesn't work — Robert.Koepferl@...
[#83985] Perl 6 style regular expressions — mark <msparshatt@...>
I was wondering if anyone has done any work on implementing Perl 6 style
[#83987] Project suggestion: Ruby code indenter — Gavin Sinclair <gsinclair@...>
From the thread "Extension Language for a Text Editor":
* Gavin Sinclair <gsinclair@soyabean.com.au> [Oct, 10 2003 18:20]:
[#84041] mysql_num_rows equivalent for DBI? — Ben Giddings <bg-rubytalk@...>
Is there a database-independent way of finding out how many rows were
paul vudmaska wrote:
On Sun, Oct 12, 2003 at 05:17:19AM +0900, Ben Giddings wrote:
[#84049] splitting a line by columns — "Mike Campbell" <michael_s_campbell@...>
I have a line of text output in columnar form; what's the best way to split it
[#84056] Newbie Class variable question — Elias Athanasopoulos <elathan@...>
Hello!
[#84060] RDoc and i18n — KUBO Takehiro <kubo@...>
Hi,
KUBO Takehiro <kubo@jiubao.org> writes:
On Sun, 19 Oct 2003 23:27:41 +0900, Dave Thomas wrote:
[#84070] XPath and HTML — David Corbin <dcorbin@...>
Is there a library out there that let's me parse HTML and use XPath
On Mon, 13 Oct 2003, David Corbin wrote:
On Sunday 12 October 2003 17:36, Chad Fowler wrote:
On Mon, 13 Oct 2003, David Corbin wrote:
[#84092] Resurrecting German mailing list? — "Josef 'Jupp' SCHUGT" <jupp@...>
Hi!
[#84145] Parentheses — Nikolai Weibull <ruby-talk@...>
Hi,
[#84159] Rubygarden oddness — "Berger, Daniel" <djberge@...>
All,
[#84165] Re: Parentheses — Michael Campbell <michael_s_campbell@...>
Yukihiro Matsumoto wrote:
[#84169] General Ruby Programming questions — Simon Kitching <simon@...>
Simon Kitching wrote:
Florian Gross (flgr@ccan.de) wrote:
Hi Florian..
> [Simon wrote:]
On Thu, 2003-10-16 at 13:06, Gavin Sinclair wrote:
> [Simon wrote:]
Simon Kitching (simon@ecnetwork.co.nz) wrote:
Eric Hodel wrote:
[#84224] OT: Strict typing on large projects — Michael Campbell <michael_s_campbell@...>
I don't necessarily mean to stir a pot here, but was reading an
On Sat, Oct 18, 2003 at 05:41:03AM +0900, Michael Campbell quipped:
[#84235] POLS ANT file pattern in Ruby — "Robert Dawson" <robert@...>
Hi,
[#84236] rubylucene - new & improved — Erik Hatcher <erik@...>
I had the pleasure of working with Rich Kilmer for a bit last weekend
[#84248] Outdated page(s) on ruby-lang.org? — Hal Fulton <hal9000@...>
A guy I (barely) know just tried to download Ruby
Hi!
Josef 'Jupp' SCHUGT wrote:
[#84251] ANN: rjava — Hans Jörg Hessmann <hessmann@...>
RJava enables you to use Java classes from ruby using ruby-like syntax. For
[#84253] Email Harvesting — Nikolai Weibull <ruby-talk@...>
I've been receiving a lot of Swen emails to my ruby-talk address lately.
Hi,
[#84283] Any shift/reduce experts out there? — Jim Freeze <jim@...>
Hi:
On Tue, 21 Oct 2003 03:47:03 +0900
On Tuesday, 21 October 2003 at 3:52:29 +0900, Ryan Pavlik wrote:
* Jim Freeze <jim@freeze.org> [Oct, 20 2003 21:20]:
[#84288] Mutex and Ruby Documentation Online — "Sean O'Dell" <sean@...>
I'm running into that mutex problem, where I need the same process to be able
[#84299] Re: Outdated page(s) on ruby-lang.org? — "Pe, Botp" <botp@...>
sir matz@ruby-lang.org [mailto:matz@ruby-lang.org] humbly replied:
[#84305] Time: safe way to go to next day? — Emmanuel Touzery <emmanuel.touzery@...>
Hello,
[#84311] Formal Language Semantics — "Christopher C.Aycock" <christopher.aycock@...>
Does anyone know where I can get the formal language semantics for Ruby
[#84331] Re: Email Harvesting — Greg Vaughn <gvaughn@...>
Ryan Dlugosz said:
On Wed, 22 Oct 2003, Greg Vaughn wrote:
On Wed, 22 Oct 2003 08:35:32 +0900, Hugh Sasse Staff Elec Eng
On Wed, 22 Oct 2003, Ruben Vandeginste wrote:
On Wed, 22 Oct 2003 18:34:32 +0900, Hugh Sasse Staff Elec Eng
[#84332] Array not Comparable? — "Warren Brown" <wkb@...>
In the past I have sorted arrays of arrays and so I knew that Array
Warren Brown wrote:
>>>>> "E" == Emmanuel Touzery <emmanuel.touzery@wanadoo.fr> writes:
On Wednesday, October 22, 2003, 11:49:17 PM, ts wrote:
[#84341] Ruby-oriented Linux distro? — Hal Fulton <hal9000@...>
There's been some talk of something like this in the past.
On Wednesday, October 22, 2003, 6:01:16 PM, Hal wrote:
On Wednesday 22 Oct 2003 11:02 am, Gavin Sinclair wrote:
On Wed, Oct 22, 2003 at 08:03:19PM +0900, Andrew Walrond wrote:
On Wednesday 22 Oct 2003 2:48 pm, Michael Garriss wrote:
On Wed, Oct 22, 2003 at 10:55:15PM +0900, Andrew Walrond wrote:
Michael Garriss wrote:
[#84350] ML <-> NG gateway is not working — Gavin Sinclair <gsinclair@...>
Folks,
[#84400] RubyGarden Wiki error — "Dmitry V. Sabanin" <sdmitry@...>
I got this today while trying to edit my wiki-page at
[#84420] Struggling with variable arguments to block — "Gavin Sinclair" <gsinclair@...>
Hi -talk,
Hi,
Yukihiro Matsumoto wrote:
Hi,
On Sat, 25 Oct 2003 00:03:32 +0900, Yukihiro Matsumoto wrote:
Hi,
Hi --
[#84462] Suggestion for an XML and ZLIB library? — Daniel Carrera <dcarrera@...>
Greetings all,
[#84467] Rubyx logo idea — Andrew Walrond <andrew@...>
I've been thinking about a logo for Rubyx, my ruby based linux distro.
[#84480] How to include zip in a program. — Daniel Carrera <dcarrera@...>
Hello all,
[#84485] Win32OLE issue in 1.8.0 — Steve Tuckner <STUCKNER@...>
[#84501] File class doesn't work! — Daniel Carrera <dcarrera@...>
Something is severely broken with my installation:
[#84514] Formatting (ANSI) highlighted strings — Gavin Sinclair <gsinclair@...>
Hi folks,
[#84529] Win32OLE again — Steve Tuckner <STUCKNER@...>
>>>>> "S" == Steve Tuckner <STUCKNER@MULTITECH.COM> writes:
[#84530] Crash in ruby 1.8.0 — "Brett H. Williams" <brett_williams@...>
This doesn't look right...
[#84531] OOoExtract v0.1 — Daniel Carrera <dcarrera@...>
Greetings,
[#84534] Fatal recycling of SystemStackErrors — Florian Gross <flgr@...>
Moin!
[#84543] Ruby and XUL? — Daniel Carrera <dcarrera@...>
Hi all,
[#84554] getoption long question — Daniel Bretoi <lists@...>
opts = GetoptLong.new(_
[#84555] system() isn't safe on win32 — Florian Gross <flgr@...>
Moin!
[#84574] Problem with seeking in existing files. — <agemoagemo@...>
I'm trying to write a program that will be writing
Hi,
[#84577] ruby 1.8.1 preview1 — matz@... (Yukihiro Matsumoto)
It's out.
On Thu, 2003-10-30 at 04:41, Yukihiro Matsumoto wrote:
[#84585] Re: [ANN] win32-file 0.1.0 — "Berger, Daniel" <djberge@...>
> -----Original Message-----
[#84603] 1.8.1 failure — Daniel Berger <djberge@...>
Solaris 9
[#84604] ruby-dev summary 21637-21729 — Takaaki Tateishi <ttate@...>
Hello,
On Fri, Oct 31, 2003 at 07:01:28AM +0900, Takaaki Tateishi wrote:
Hi,
On Thu, Nov 06, 2003 at 11:17:59PM +0900, Yukihiro Matsumoto wrote:
Hi,
On Fri, Nov 07, 2003 at 12:36:23AM +0900, Yukihiro Matsumoto wrote:
[#84611] 64-bit Ruby on Solaris? — Daniel Berger <djberge@...>
Hi all,
[#84626] Since today is October 31... — Hal Fulton <hal9000@...>
srand 0
Re: Extension Language for a Text Editor
On Fri, 10 Oct 2003 02:36:25 +0900
Nikolai Weibull <ruby-talk@pcppopper.org> wrote:
> * Ryan Pavlik <rpav@mephle.com> [Oct, 09 2003 09:10]:
> [stuff about Emacs and Vim]
> > Well, whichever, just be aware that emacs is designed as an extensible
> > editor, and vim is not, even though such things have crept in with
> > varying degrees of usefulness.
> Yes, that, as I see it, is Emacs biggest win. The big problem I see
> with Vim is that it hasn't undergone a major overhaul. It is basically
> Emacs written in C now.
Not really. It's vi with lots of hacks to do more stuff added. So
much for being a tiny, bloat-free editor. ;-)
> Vim is, in my opinion, probably the best editor that exists right
> now. It is, however, going to reach a point where adding new
> features will demand some sort of rewrite. With Emacs, things like
> these are easy to alter. Anyway, Vim is extensible, it is, however,
> not _changable_. By that I mean that, if you want to change the way
> folding works, you must rewrite the core of Vim.
Actually that'd be the other way around. vim is changeable... you can
alter the C core... but it's not extensible: you can't really add
extensions. _This_ is what causes feature creep and bloat. Not
having 20 million extensions that do everything imaginable. Being
able to add extensions means you're able to _remove_ them. Rolling
stuff into the core means you've got a bloated editor.
Somewhat ironic.
Now, I don't want to start an editor war here. This could very easily
turn into one, and that would totally defeat the point. Therefore,
let's look at emacs and vim in terms of the interface concepts they
embody, such as interactivity, modality, extensibility, etc, rather
than implementation faults. Implementation is irrelevant since you're
implementing something new.
So basically, if you like a modal editor or not, go for editor of form
of your choice. I've seriously considered switching to vim simply
because of the ruby support. (A few things have kept me from doing
this, but they were merely technical issues.)
> And, as Bram pointed out in some interview, that means altering
> basically every file in the Vim distribution. To Vim's salvation
> comes the ability to easily define new syntax definitions and
> indentation definitions, which one has to agree, are a lot easier to
> create and alter than with Emacs (Emacs being perhaps more powerful
> though).
Not really, the emacs syntax bits are pretty trivial to do. They look
worse than they are; I was hacking around on the ruby-mode, and it was
much easier to modify than it appears.
Now, this isn't really emacs vs vim; it's just a matter of philosphy.
You could trivially add code in emacs to do vim-ish syntax
descriptions, and I'm sure you could add code in vim to do more
scripted syntax.
The point to note is that it'd be a lot less work to convert
simplified syntax into complex syntax than it is to add scripted
syntax later.
> [stuff about Ruby libraries and such]
> > Right. They're there, people can write extensions that interface to
> > the web, or whatever.
> Yes, but I don't want an Operating System. I guess, to a certain degree
> the library you get helps you, but it can also detract you from the
> central topic, namely editing text.
I know it's a typical joke to say "emacs isn't an editor, it's an OS",
but remember---it's a joke. Don't build your editor based on jokes.
In truth the emacs core is very tight: it provides a buffer-oriented
language and interface elements. Because it's general, people have
written lots of stuff, some of which is quite silly (tetris, web
browser, etc.), but is also a testament to flexibility. You can be
sure that if you can make it play tetris, you can also make it edit
text in any conceivable way.
Of course this isn't limited to emacs-style editing. Plenty of
editors are scriptable; you could implement scripting capabilities and
provide any interface you want. Same deal. Flexibilty, however, is
something worth considering.
> > See http://ogmo.mephle.org/tabular-alignment.org for the Lisp
> > version. The ruby one I deleted, as it was pretty simple to
> > reproduce, I'm sure someoone can whip up an example.
> Yeah, OK. I see your point. It is, however, very easy to alter to fit
> your own needs. Change some global variables and you can make it work
> for almost anything. I can't tell, but I'm guessing your code in Ruby
> wouldn't allow for this?
Actually the ruby version and the lisp version are almost identical,
API-wise. I just wrote a function in ruby that took a string and a
regexp, and returned the aligned string. The fact the emacs one goes
through and replaces buffer text is the only real difference.
> I'm not trying to contract you, only point out that Emacs extensions
> are, as oposed to Vim extensions, very flexible and well thought
> out. This does, of course, not mean that it can't be done in Ruby.
> I just get the feeling that Lisp excels at this.
Well. I definitely agree about the emacs extensions vs vim ones.
This is mostly philosophical IMO, as stated above. What makes
extensions more flexible is not the language, exactly, but the
philosophy you have for extensions. If it's "you can run a script on
the text" (like the ruby vim module), you don't get a lot to work
with. If it's "you can hook into every conceivable part of the
editor", or (like the sawfish window manager) "all higher-level
functionality is implemented in the scripting language", you have
extreme flexibility.
That said, one of the nice things about ruby is that it has taken a
_lot_ of direction from Lisp. There are _many_ little things that
just make it more convenient to use (closures, for instance).
Convenience when writing extensions is greatly appreciated by
users. ;-)
> [stuff about functional vs. OO being more well suited for editing
> text]
> > I don't really find that. I don't think functional programming is any
> > easier for editor-related tasks. I'm not even sure how you would come
> > up with such an assumption. ;)
> My real point was that having OO around doesn't really help either. It
> doesn't add anything. Sure, you can make classes like Buffer and Window,
> were is the real gain?
The first gain is elegance. Uniformity. You know where to look when
you want a method to alter Window; you look in the Window class. You
don't look for all the functions that may or may not have "-window" in
them. (This is a major issue I've had with both sawfish and emacs;
the nomenclature is not uniform. This may be considered purely
implementational, but people tend to be lazy, or they've approached
something from an unusual angle, and things break down.)
The second is extensibility. If I want to alter how the buffer is
handled, I have to look for hooks (if they're provided) and make sure
to set all the right global variables (ugh) and change the keys, etc.
With the object-oriented approach, I just subclass Buffer and override
what I need. (Or perhaps I merely make a new interface class.) It's
much more straightforward, and again, more elegant.
> I have tried to envision some OO structure for implementing Emacs
> like Major/Minor Modes and such, but I haven't been able to come to
> any satisfactory results. I mean, how is a Major Mode an object?
> Really?
This is because you're trying to do a direct transliteration of emacs
to OOP. This doesn't work. Step back and see first what you're
trying to accomplish, and then design an object structure that handles
it, while sticking to the _philosophy_ of emacs ("script everything").
Just off the top of my head, you don't want modes, first off. They're
too constraining. The major problem is that you can't have multiple
"major" modes without a lot of hackery (if at all). What you ask
yourself is: what do modes provide? The answer: buffer behavior.
What might be better: behavior objects. You have a class hierarchy to
modify various aspects, and you put these together to build your
favorite buffer behavior. This way you could have multiple syntaxes
per buffer, for instance.
Configuration would simply be changing the object properties. For
instance, if you get a hilighter object as 'syntax', you might:
:
syntax.comment_color = BLUE;
syntax.variable_color = RED;
:
The 'syntax' object could be a subclass of a more general Formatter,
and you may even have a subclass per language, where you have the
ability to implement specifics if necessary. A basic SyntaxHilighter
could provide simple regexp hilights that everyone would use anyway.
> I guess it has a syntax definition, a separate keybinding mapping,
> an indentation callback, maybe something else? I just don't feel it
> adds anything though. I am, of course open to suggestions ;-).
The main thing I'd suggest is to look at what things _mean_, and what
they _could_ be... don't necessarily mimic the way things are
implemented right now.
> > Right, tiny C core like emacs, everything higher-level in the language
> > of choice. Ruby is highly suited for this task.
> Yeah, this is true. Ruby would be well suited for this I do
> believe. But note that Emacs C core isn't very small ;-)
The emacs C core includes elisp, which isn't exactly fair; count all
the lines of vim and perl, and you won't find it too small either. ;-)
> > People could even write high-performance ruby extensions in C...
> Yeah, this would be easy to do as well. There is, of course, the
> inherent risk of not being portable enough. Vim supports this in a way,
> and I have never seen it used to date.
True, but ruby extensions tend to be fairly portable. Don't worry
about enforcing this. If people want it, they'll port it. It'd
likely be a rare occurance it happens at all. (Maybe some really fast
text munger; I dunno.)
> [stuff about regular expressions]
> > Well, to be blunt, whatever you come up with won't be as popular or
> > useful as the existing regular expressions, just because they'll be a
> > nonstandard replacement of something already very common. PCRE
> > regexps are extremely flexible and well-known.
> As useful? Please, my dear sir, there has to be something better than
> the way we describe regular expressions now.
Better? Perhaps. I would first want to know what is wrong with
existing regular expressions. (Now, I dislike the overuse of regexps,
and tend to avoid them in my code, but when you're writing editor code
or parsers it's a different story.) Consider:
1. Do you feel they could be improved in form alone, or
functionality?
2. What form should they take, it not the current form?
3. What function should they accomplish, that they do not
currently accomplish?
4. Is the action you're trying to take actually something you
should be using regexps for, or is there a better way?
> At least for searching text. The syntax we have today for regular
> expressions is basically the same, only extended, as that that Ken
> Thompson uses in his 1968 paper on it. Or that of _real_ regular
> expressions long before it. And remember, real regular expressions
> only have * (Kleene star) and no +.
Just because something is old doesn't mean it's bad. Text is text.
That hasn't changed since 1968 or 1908 or 1809 or long before. ;)
Only the content.
The method of handling it has gotten more complex, because we've gone
from purely academic uses to actual everyday useful uses.
> There has to be a simpler syntax that can be useful for
> interactive text search-and-replaces.
There might be. There are simpler syntaxes, but they usually trade
off on functionality. There are GUI regexp builders.
I'm definitely a fan of throwing things out the window when they need
to be. But the first thing to determine is what you're trying to
accomplish, and how throwing things away lets you accomplish it.
> Look at Vim, Emacs, and Perl (and thus, basically, Ruby)'s syntax.
> They are all extensions of this, adding new short cryptic ways of
> saying things that you often don't need, and if you did you wouldn't
> want to do it that way anyway. The real example of how it has
> gotten out of hand is the overuse of backslash (\). It is
> everywhere. <snip more obscure things>
There are really two things at play here. The first is commonality.
Everyone uses backslashes for escaping, from C to bash. You need to
escape things, so backslash is as good as any, and everyone is
familiar with it. This is good.
Obscure feature creep is less good. I am not a fan of Perl's "a
kitchen sink for every occasion" philosophy (don't get me started
here), but if you start getting tons of special cases, maybe your
instincts are right: maybe we need something new. But maybe it's not
regular expressions, either.
> > That isn't to say people won't use them, especially if they're
> > simpler, but it probably won't be the main selling point of your
> > editor to _other people_.
> Nah OK. You've got a point. But, as with most free software, this
> one's for me ;-). If anyone wants to tag along later on, fine. But I
> won't care if no one is interested, Emacs and Vim are fine editors.
> Even notepad has its uses. It can, for example, tell you if a file is
> smaller or greater than 65535 bytes very easily ;-).
Actually this is good, I think. If you're writing an editor to be
popular, it probably won't. If you're writing it to be useful to you,
it'll probably be popular with others who have similar needs.
> I have, perhaps, failed to describe the real winning here. (Alas, I
> realize I forgot to mention it.) As you perhaps know, Vim, and most
> other UNIX software, operate on a line-by-line basis. This restriction
> would not impede the command language I'm contemplating. If you take a
> look at the Sam editor[2], this is its main selling point, and this is
> another one I want to include.
Not sure what you're getting at here, but it seems interesting...
<snip>
> > I'm not sure how that's a problem. The same applies to // regexps.
> > They're just basically strings, except stored in a different type of
> > object with a few flags.
> Nono, they don't do string escapes. \n in a regex (//) means match a
> newline, not substitute this for 0x0a. So, you don't have to quote it
> with an extra backslash to get that meaning.
<snip>
Hmm, I think I see what you mean. You could just use '' though, which
does it for you:
irb> s = '\n'
=> "\\n"
<snip>
> and to match a backslash itself:
> "\\\\"
> which is horrendous. In a Ruby regex, /\\/ suffices.
Yes, this is a problem I've had with elisp regexps. Too many \\'s.
I've seen lines like \\\\\\\\\\\\\\\\\\\\ before. Really painful to
read.
ttyl,
--
Ryan Pavlik <rpav@mephle.com>
"That's the first pratical line of thinking to
come out of your word hole since we first met." - 8BT