On Tuesday 14 January 2003 10:31 am, Kazuo Saito wrote: > Nobu Nakada proposed the idea for a new here-document style inspired by > [ruby-talk:50473]. In his idea, if you assign a character (except > quotes) after the here-document indicator "<<-", All blanks and > assigned character at the head of each line will be deleted. > Here is a example assigning '|': > > p <<-|EOS > | foo > | bar > EOS > # => " foo\n bar\n". > > He already posted a patch to add this function. Matz wants any > comments for the idea from all Rubyists. i have been wanting this myself. GOOD IDEA! i wonder if the - is neccessary? wouldn't <<| be enough? personally, i have always felt that << is useless and always use <<-. is there any good reason to keep << distinct from <<-? dosen't <<- serve all purposes? since << has to be flush to the beginning of the line? <<- can be, but dosen't have to be. is that correct? then again wouldn't something like this be simpler: p <<| foo | bar puts p and that's it, such that the string is completed by the fact that there is no /^\s*\|/ match on the 3rd line. just thinking aloud here. -- tom sawyer, aka transami transami / transami.net .''. .''. . *''* :_\/_: . :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. .''.: /\ : ./)\ ':'* /\ * : '..'. -=:o:=- :_\/_:'.:::. | ' *''* * '.\'/.' _\(/_'.':'.' : /\ : ::::: = *_\/_* -= o =- /)\ ' * '..' ':::' === * /\ * .'/.\'. '._____ * | *..* : |. |' .---"| * | _ .--'| || | _| | * | .-'| __ | | | || | .-----. | |' | || | | | | | || | ___' ' /"\ | '-."". '-' '-.' '` |_. ------------------------------------------------------------