43530-44138

43313-46070 subjects 43611-44681

[ANN] Vim-Remote for Ruby (pre-release)
43530 [ned@bi e- om] After the list discussion about using Vim as a front-end for the Ruby

the pains of parsing
43531 [transami@tr ] i find myself spending alot of time writing routines to parse complex
+ 43532 [guillermo.fe] I've seen that you have <, [, {, " and *  Are those the only simbols?
+ 43534 [michael_s_ca] In a general sense, you might run into serious problems with this,
+ 43535 [phasis@ko ne] How about this?
| + 43542 [transami@tr ] very impressive. i especially like the lack of regexp.
| | 43546 [phasis@ko ne] str = 'ad3<b>[c]{d}"e"f {{g}} [[h]]*i**j*"k"ll"sdfsd"z'
| | 43561 [ser@ge ma e-] Adding two characters to the regexp fixes that.  The regexp should be
| | 43569 [transami@tr ] thanks Sean and Park. its actually been interesting comparing these two
| | 43582 [harryo@zi .c] If memory serves correctly, Icon was created by the same person who designed
| + 43556 [peter@se an ] If my very rusty CS is correct this is one of the hardest types of
+ 43536 [ser@ge ma e-] This isn't the most beautiful or efficient code I've ever written, but the
  + 43544 [transami@tr ] thanks sean!
  + 43545 [transami@tr ] def tokenizer3 string

Command Expansion problem
43537 [pdm@ad so co] I am using the following command inside ruby
43543 [ruby-talk@je] irb(main):001:0> runcmd=%x{echo hai

I NEED YOUR HELP
43538 [idrial@ur ac] To your Good Attention
43540 [phlip_cpp@ya] The reason these ridiculous schemes keep coming from Africa is their
43551 [dossy@pa op ] I wonder if the African government really isn't sending these
43552 [sera@fh an .] Uh, Dossy, do you have any specific reason to speculate this way, or
43557 [dossy@pa op ] I'm just handwaving.  If that bothers you, killfile my email address.

Tk.generate_event before mainloop
43541 [phlip_cpp@ya] I'm doing a mouse- and keystroke intense app and need to test-first at that

[ANN] Ruby Conference 2002: Second call for presentation proposals
43550 [dblack@ca dl] ********************************************************************
43576 [bobx@li ux a] Where is this one being held (and when)?
43577 [james@ru yx ] From http://www.rubyconf.org

Range thoughts (was: Re: (0..3) == (0...4) returning false?)
43553 [list@NO PA c] And your guess is usually right. :-)

[ANN] Archive 0.1 and version.rb
43554 [list@NO PA c] Both modules are also included in the (to be released) development
43567 [ser@ge ma e-] Very cool, Massimiliano.

Persistant Objects
43558 [dcorbin@im e] Is there library/framework for ruby that makes doing persistant objects
43559 [vjoel@PA H. ] But it reads and writes the whole file for any transaction, which may
43560 [dcorbin@im e] You're right, that's not what I want.  What I really want, now that I
+ 43562 [J.Hawkeswort] I'm new to this so forgive me if I'm stating the obvious but won't the
| 43565 [dcorbin@im e] Well, it might from my original description.  I'm not sure how if it
| 43572 [meier@me st ] =20
| 43583 [list@NO PA c] No, that's waaay more than $0.02.  I can't wait to see this.
+ 43566 [torsten.rueg] That sounds to me like an OO database. Which does exactly that and it's
+ 43620 [dsafari@xt a] Perhaps mneumonic fits your needs?
| 43636 [dcorbin@im e] Mnemonic looks interesting.  To clarify a few things,  it looks like
+ 43624 [scobianchi@r] Any volunteers for porting Enterprise Objects Framework to Ruby?

Texas: Codefest in August?
43563 [hal9000@hy e] This is for people in Texas (or, hey, those

please kindly get back to me
43564 [peterstevens] DEAR FRIEND.

self_parent
43570 [transami@tr ] i was wondering what others thought of the idea of having a built in
+ 43571 [dblack@ca dl] My first reaction, which I'll go ahead and express although I'm kind
| 43584 [transami@tr ] all my real examples are pretty large, mostly to do with using the REXML
| + 43585 [james@ru yx ] How would an object know the methods of an arbitray parent?  Doesn't this
| | + 43591 [transami@tr ] isnt this simply a matter of design? and one that is really inherit in
| | | 43610 [james@ru yx ] Yes, if A creates B, and B changes its interface, A has a problem. That's
| | + 43941 [detering@is ] 1.) Sometimes you have this tight coupling between two
| |   44052 [transami@tr ] dirk, thank you for the comprehensive investigation into the self_parent
| |   + 44094 [list@NO PA c] One way could be to use eval with a binding coming from the object,
| |   | 44115 [matti_g@gm .] I think, you can easily write something like this
| |   + 44134 [dossy@pa op ] You said you didn't want to pass self, but given your example
| |   + 44138 [james@ru yx ] What else would OpenProc do?  Why wouldn't you do
| + 43586 [harryo@zi .c] I understand that this is an invented example that may not show all the issues
| | 43590 [transami@tr ] yes, that's true --always a problem with off the cuff fictions like the
| + 43587 [dblack@ca dl] This introduces a dependency between objects, though, based on a kind
| | + 43588 [ser@ge ma e-] Yes.  A REXML parent/child relationship has nothing to do with object
| | | + 43594 [dblack@ca dl] Moreover, the notion of "self" at the time of object creation as the
| | | | 43598 [transami@tr ] well what would be a good name if not self_parent? i see how the parent
| | | + 43595 [transami@tr ] yes, the REXML site was probably not the best. but self_parent in effect
| | |   43631 [austin@ha os] I'm sure Ruby could allow this to happen, but except in the case of
| | + 43593 [transami@tr ] yes the REXML isn't really a good example, it was just a passing
| |   43597 [dblack@ca dl] I can't argue with that last point, except to say I think there are
| |   43599 [transami@tr ] self_ancestor(Class)
| |   43603 [dblack@ca dl] If you keep at it, you might come full circle to the idea of passing
| + 43628 [list@NO PA c] C'mon, for an object to be coupled to the one where it was created is
|   + 43638 [transami@tr ] by the way, this idea actually stems from an earlier desire to have
|   | 43640 [ned@bi e- om] Do you really need a parent *class*? If you can get by with a module,
|   + 43662 [transami@tr ] well, i just passed self, again. so imust ask you, how general is
|     + 43705 [austin@ha os] In ten years of professional software development, a good chunk of
|     | 43713 [michael_s_ca] I can't think of an instance where I have either.  I've passed self
|     | + 43729 [dossy@pa op ] Has no one around here ever implemented the Visitor pattern!?
|     | | 43750 [michael_s_ca] Haven't had a need to as yet for what I've done.
|     | + 43731 [transami@tr ] okay, i grant you i write code very differently then most others. at
|     |   43740 [dossy@pa op ] Dosen't sound like it's reduced very far.
|     |   + 43741 [transami@tr ] # Zen Accounting - ZenCustomer
|     |   | 43743 [Dave@Pr gm t] Well, if you'd like to remove duplication, how about (untested)...
|     |   | 43753 [transami@tr ] ha! that's funny, that's exactly what i was working towards! thanks for
|     |   | + 43755 [Dave@Pr gm t] Perhaps it might help to think of it in terms of coupling: which
|     |   | + 43789 [dossy@pa op ] The only place where I see passing self as being The Right Thing To Do
|     |   + 43745 [dblack@ca dl] Also (again, the terminological problem), the thing we're talking
|     |   | + 43746 [austin@ha os] Anyway, doesn't Ruby have a way to handle some of this now? In
|     |   | + 43790 [dossy@pa op ] Is there a concrete example where the only way to implement something
|     |   |   43801 [dblack@ca dl] I can't think of an example either -- and actually, I think it's
|     |   + 43749 [ned@bi e- om] We have, but don't necessarily think it's the best of both worlds.
|     + 43711 [list@NO PA c] And I guess that even `somewhere' is very distant from `almost
+ 43627 [chr_news@gm ] Normally I not that picky about names but ``self_parent'' , especially
  43629 [chr_news@gm ] A never mind ... I missed your fictional example

SV: self_parent
43573 [tsondergaard] ...

File as string
43579 [briqueabraqu] How can I open a file as a single string (with many \n inside) instead
+ 43580 [nobu.nokada@] open(file) {|f| f.read}
+ 43581 [g_ogata@op u] File.open('filename') {|f| f.read}

Embedding variable numbers of parmeters
43592 [wardja@jm .e] I'm working on doing some embedding work and I have a function defined
43601 [vjoel@PA H. ] Are you using -1 as your argc in rb_define_method? Using -1 asks the

is there a better string.each?
43602 [tspivey8@te ] a="canada"
+ 43605 [dossy@pa op ] "canada".split(//).each { |i| p i }
| 43607 [dblack@ca dl] There's also String#each_byte, which will give you the numerical
+ 43606 [transami@tr ] a = "canada"
| + 43608 [dossy@pa op ] A String is a string.  An Array is an array.  Any coincidence that
| | + 43614 [transami@tr ] no way dude!
| | | + 43615 [ned@bi e- om] In many Smalltalks String is either a kind of Array or a sibling class
| | | + 43646 [in6x059@pu l] This works fine for German and English Strings. Does this uphold for
| | |   43651 [dossy@pa op ] No.  Not for Japanese, Chinese, Korean, Russian, (I think) Hebrew ...
| | |   + 43657 [dcorbin@im e] A String *is*: an Array of Characters + a CharacterSet, IMHO.  Whether
| | |   + 43672 [tobiasreif@p] so it's still
| | |     43676 [dblack@ca dl] If you literally mean that String should be understood as inheriting
| | |     43679 [tobiasreif@p] stuff that's not shared could be undef'd, or not included
| | |     43680 [dblack@ca dl] I think there's more to some of the relationship between strings and
| | |     43685 [tobiasreif@p] just to show that
| | |     43698 [dblack@ca dl] You did understand: I was flagging the design issue (the
| | + 43670 [tobiasreif@p] it is by definition, not by coincidence, no?
| |   43688 [hal9000@hy e] No, not by definition... a string is certainly
| |   43692 [tobiasreif@p] I was refering to the realm of common sense, which only shares some
| |   + 43708 [in6x059@pu l] common sense is tightly coupled to the culture you live in or come from.
| |   + 43716 [ser@ge ma e-] Hah!  That's got to go in my .sig file!
| + 43644 [ser@ge ma e-] This is something which bites everybody, I think, at some point.
| | 43645 [michael_s_ca] Not to be a pedant, but this seems like a huge breakage of the POLS,
| | + 43660 [hal9000@hy e] I see your point, but I disagree.
| | | + 43663 [michael_s_ca] Oh yes, I was playing devils advocate to a certain degree.
| | | | 43687 [hal9000@hy e] Oh, yes, that's true. I didn't mean that the
| | | | 43689 [michael_s_ca] Well, no.  The earliest I remember was about that time, but came from
| | | | 43724 [matz@ru y- a] I've never claimed I "invented" the idea.  It's introduced to the Ruby
| | | | 43727 [michael_s_ca] I didn't mean to imply that you ever claimed such; just a feeling I
| | | + 43664 [transami@tr ] like c was the only languge before ruby came along?
| | | | 43734 [tsiivola@cc ] IMO this is the heart of the matter: the technical core of strings vs.
| | | | + 43735 [tobiasreif@p] ... which are all arrays of characters.
| | | | + 43758 [alan@di ik t] I would love to see a separation of the code for String when used as a
| | | + 43675 [tobiasreif@p] yes
| | | + 43707 [ser@ge ma e-] But Strings /are/ arrays, by your own definition words.  Really, a String is
| | |   43714 [michael_s_ca] Are ordered sets of characters in a sorted tree structure Arrays?
| | |   43774 [ser@ge ma e-] I don't know of a better definition of "Array" than "an ordered set of
| | |   + 43777 [jweirich@on ] Technically, arrays aren't sets.  An element may appear in an array
| | |   | + 43779 [transami@tr ] indeed, they arn't matching. and it would be nice if we could come to a
| | |   | | 43792 [dossy@pa op ] I don't know Matz very well, but perhaps the reason why String#each
| | |   | | + 43793 [austin@ha os] Minor correction, here -- terminated by a record separator, not a
| | |   | | + 43820 [tobiasreif@p] String#characters would be cool.
| | |   | |   43826 [dossy@pa op ] This fails when the string is encoded in a multi-byte encoding (such
| | |   | |   + 43830 [dblack@ca dl] Not if the return value is an array.  This example doesn't include
| | |   | |   | + 43831 [tobiasreif@p] yep. Dossy, that's what I meant with "it would probably pass the chars
| | |   | |   | + 43925 [ser@ge ma e-] David, again, to the rescue.
| | |   | |   + 43838 [nobu.nokada@] String#split is multi-byte aware.
| | |   | |     43879 [dossy@pa op ] Oh, hey, wow!  Who snuck this in and where was it documented?  :-)
| | |   | |     43885 [martine@cs w] Of course Ruby works with Japanese encodings... it's used by Japanese
| | |   | |     + 43887 [dossy@pa op ] In other words, setting $KCODE="UTF8" doesn't Do The Right Thing?
| | |   | |     | 43895 [nobu.nokada@] It works.
| | |   | |     + 43902 [matz@ru y- a] UTF-8 is supported just as much as EUC.
| | |   | + 43918 [ser@ge ma e-] Well, you're right of course.  This also means that Strings also aren't, in
| | |   + 43805 [michael_s_ca] That's not what I said.
| | |     + 43821 [tobiasreif@p] True, but the term "array" has meaning outside computer language
| | |     | 43833 [michael_s_ca] They might, but even THEY would agree it NEED not.  Which was the assertion that
| | |     + 43848 [hal9000@hy e] Yes, quite right. A linked list is also an
| | |       + 43853 [michael_s_ca] Precisely; no more than I would say a String "is a"[n] Array.  A
| | |       | 43858 [transami@tr ] Percisely? ha! you guys are killing me. :-)
| | |       | + 43862 [austin@ha os] C and C++ are very bad examples of this because they have
| | |       | | + 43872 [ned@bi e- om] Certainly the ANSI C++ string class has a very different (and much
| | |       | | + 43880 [dossy@pa op ] Exactly.
| | |       | + 43874 [michael_s_ca] How can anything be implemented as anything else, by that logic.
| | |       |   43877 [transami@tr ] i don't program in c/c++.
| | |       |   + 43882 [dossy@pa op ] I see.  From your previous messages, I was lead to believe that
| | |       |   + 43883 [austin@ha os] I think what we're trying to get at is that the C/C++ model of char*
| | |       + 43855 [transami@tr ] "Yes, quite right. A *cat* is also an *animal*.
| | |         + 43856 [hal9000@hy e] But you were saying that a string is an array
| | |         | 43859 [transami@tr ] no that is not right.
| | |         | + 43861 [hal9000@hy e] I never said a linked list was an array. I said that, like an
| | |         | | 43926 [ser@ge ma e-] And what /I'm/ saying is: it looks like an array, it acts like an array, it
| | |         | | 43931 [decoux@mo lo] If a string is an array, just try to make a RCO from it.
| | |         | | + 43932 [transami@tr ] what's an RCO?
| | |         | | | 43933 [decoux@mo lo] Recursive Container Object
| | |         | | | 43935 [transami@tr ] i see. ROC? no. what sean is saying is not that string = array, but that
| | |         | | | 43936 [decoux@mo lo] No, RCO :-)
| | |         | | | 43944 [g_ogata@op u] Well, "usefulness" depends on the application.  And it seems that
| | |         | | | + 43945 [dblack@ca dl] [same for Chars, Lines, etc]
| | |         | | | + 43951 [jweirich@on ] The only problem I have with this suggestions is that
| | |         | | | + 43954 [transami@tr ] in response to George Ogata.
| | |         | | | | 43993 [tobiasreif@p] To delimit paragraphs, sections, headers, footers, etc, one uses
| | |         | | | + 43959 [austin@ha os] I don't actually find it ambiguous, although I think that it's
| | |         | | | | + 43999 [transami@tr ] austin, i think you are getting to the core of what's really wanted from
| | |         | | | | | + 44003 [tobiasreif@p] so what about a simple RCR, asking for
| | |         | | | | | | + 44004 [hal9000@hy e] Better perhaps to try it in Ruby awhile
| | |         | | | | | | | + 44007 [nobu.nokada@] def each_char(&block)
| | |         | | | | | | | + 44037 [ser@ge ma e-] As I've said before, this is a nice solution, Hal.  However, I would expect
| | |         | | | | | | |   + 44040 [hal9000@hy e] expect
| | |         | | | | | | |   | 44041 [harryo@zi .c] I don't think the main thrust was performance.  It's just that the split
| | |         | | | | | | |   + 44059 [tobiasreif@p] ... and
| | |         | | | | | | |   + 44074 [dblack@ca dl] I think part of the original #chars idea was that it would return an
| | |         | | | | | | + 44005 [austin@ha os] I think that this could work. I also think that an RCR should be
| | |         | | | | | |   44010 [transami@tr ] if/when $/ accepts regexps, what about '' as a seperator meaning each
| | |         | | | | | + 44006 [dblack@ca dl] You can do: string.split("")
| | |         | | | | + 44011 [dblack@ca dl] str.split(//).each ...
| | |         | | | |   + 44014 [austin@ha os] I agree. However, even though the code may be different, that's
| | |         | | | |   + 44015 [transami@tr ] david,
| | |         | | | + 43962 [alwagner@tc ] I think that this thread reveals a serious confusion about the difference
| | |         | | | + 43965 [ned@bi e- om] I think some of the discussion about String is confusing Strings with
| | |         | | | + 43966 [matz@ru y- a] Agreed.
| | |         | | | | + 43972 [olonichev@sc] I have compiled Berkeley DB 3.3.11 and bdb-0.3.1 under cygwin.
| | |         | | | | + 44035 [ser@ge ma e-] I'm sorry.  I've forgotten who originally suggested this, but the best
| | |         | | | + 43968 [ned@bi e- om] There is no easy definition for "words" or "paragraphs" that works
| | |         | | | + 43980 [qrczak@kn .o] Because they aren't differences between the data, but differences
| | |         | | |   + 43994 [alwagner@tc ] I don't understand.  Why would you ever have to choose the interation method
| | |         | | |   + 43998 [tobiasreif@p] absolutely.
| | |         | | + 44034 [ser@ge ma e-] 'RCO'?
| | |         | |   44072 [decoux@mo lo] Apparently, you are working with "text" files, this is not my case.
| | |         | |   44099 [ser@ge ma e-] Hmm?  You use Strings for something other than text?
| | |         | |   44116 [ned@bi e- om] Sure. Tried to read Zip file headers recently?
| | |         | + 43886 [dossy@pa op ] A linked list maintains order.
| | |         |   43889 [transami@tr ] i think you all have taken my words much further then they were
| | |         |   43903 [matz@ru y- a] * a string is not an array.
| | |         |   43911 [akr@m1 n. rg] A immutable(frozen) string is the subtype of a immutable(frozen)
| | |         + 43884 [dossy@pa op ] If the language you're working in implemented Arrays as
| | + 43694 [ser@ge ma e-] Yeah, but this is a known problem that is waiting for the m17n (i18n?)
| | | 43723 [piman@sa re ] ng=20
| | + 43704 [austin@ha os] I don't think so; IMO, the PoLS is what is least surprising overall
| | + 43725 [matz@ru y- a] I may surprise you, or even make mistake (often).  But still, since
| + 43648 [Dave@Pr gm t] Perhaps it might be better to say that (currently) the implementation
|   + 43652 [dossy@pa op ] I'm definitely all for this.  This way, when m17n gets implemented
|   | 43712 [list@NO PA c] Hard to say, but it is probably worth a poll.
|   + 43671 [tobiasreif@p] why not as Characters?
|   + 43693 [ser@ge ma e-] I so completely agree with you, that I'm wondering if you aren't channeling
+ 43618 [juergen.kati] do i loop over all the characters?
  43632 [austin@ha os] each
threads.html
top