On Fri, 17 Jan 2003, Tom Sawyer wrote:

> On Friday 17 January 2003 04:19 am, Hugh Sasse Staff Elec Eng wrote:
> > OK, what about this suggestion in the OO spirit of Ruby?
> >
> >      puts <<("interpolate", "indent", "indent terminator")|EOS
> >             |   string
> >             EOS
> >
> Hugh,
>
> this is an interesting attempt at making here docs OO, yet it dosen't quite
> get there. the only thing i can see to do would be to take a block that the

No, it doesn't get there, agreed....

> here doc is within. maybe something like this:
>
>       puts <<("interpolate", "indent", "indent terminator", "|") {
> 	     EOS
>              |   string
>              EOS
> 	}
>
> i take it the interoplate is a true/false argument? indent is equiv. to

Defaults to false, if the string/symbol/... is present it is true...
> tabto(n)? and what about the indent terminator, what is that?

        "interpolate"       -> EOS rather than 'EOS'
        "indent"            -> proposed | syntax
        "indent terminator  -> -EOS rather than EOS
>
> but this sort of "long-winds" the whole deal....

Well, there could be short forms, but the idea is to make it clear
what is happening.  This is "green hat" thinking at the moment,
trying to propose a more Rubyesque way to doing things, in the same
way that you can use $/ and friends if you like, but there are other
ways.
>
> no one responded to my suggestion of leaving here docs alnone and instead
> adding a variant syntax to the %Q, %q construction. i.e.
>
> %Q-| string
>
> was it really such a bad idea?

I prefer your %- because I don't like the %Qxthisx having an
exception where x == -.

Actually, for the % things, I'd like one where \ is NOT interpreted.
But that's for another thread, and I'm not sure it's worthy enough
to raise.  I was thinking of gsub( '/', %b{\} )....
>
> --
> tom sawyer, aka transami
> transami / transami.net
>

        Hugh