[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Suggestions for RDoc

Nikolai Weibull

3/17/2005 1:46:00 PM

I have two suggestions for RDoc fixes:

1. Object#[] doesn't get documented, at least not in C sources.

2. Could the parser perhaps drop folding-markers from the source? An
example comment with a folding-marker would be:

/* {{{1
*
* call-seq:
* ...
*/

The documentation looks rediculous when these are included. A
solutions is to separate the marker from the documentation:

/* {{{1 */
/*
* call-seq:
* ...
*/

but it still seems, to me, that RDoc could take care of removing
them.

A regex to match folding-markers with could be expressed like:

/(?:{{{|}}})\d*/

It's pretty standard.

Perhaps a good solution to #2 is to allow project-specific inclusions of
parsers. What do you think?,
nikolai

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


3 Answers

Eric Hodel

3/17/2005 5:52:00 PM

0

On 17 Mar 2005, at 05:46, Nikolai Weibull wrote:

> I have two suggestions for RDoc fixes:
>
> 1. Object#[] doesn't get documented, at least not in C sources.

$ ruby
Object.new.[]
-:1: undefined method `[]' for #<Object:0x133bd4> (NoMethodError)

Unless I'm confused, I don't think there is an Object#[].

Array::[] is RDoc'd.

The Array creation syntax [] and [5, 6] is done by the
parser/interpreter. This makes an inline Array which is built by
eval.c, so there isn't an equivalent method call on the Ruby side:

$ parse_tree_show -f
array1 = []
array2 = [5, 6, 7]
[snip]
[:lasgn, :array1, [:zarray]],
[:lasgn, :array2, [:array, [:lit, 5], [:lit, 6], [:lit, 7]]]

NODE_ZARRAY is an empty array, while NODE_ARRAY is used to construct a
new Array object.

A method call looks like this, where the NODE_ARRAY node is used for
the argument list:

$ parse_tree_show -f
1 + 1
[snip]
[:call, [:lit, 1], :+, [:array, [:lit, 1]]]

--
Eric Hodel - drbrain@segment7.net - http://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Nikolai Weibull

3/17/2005 8:54:00 PM

0

* Eric Hodel (Mar 17, 2005 19:00):
> > 1. Object#[] doesn't get documented, at least not in C sources.

> $ ruby Object.new.[] -:1: undefined method `[]' for #<Object:0x133bd4>
> (NoMethodError)

Badly written, sorry. Object was supposed to be <object>, as in any
object, not necessarily an instance of the Object Class. I don't know
what I was thinking when I wrote it. What I meant was that it doesn't
get linked in a description text for a method, i.e.,

/*
* call-seq:
* ...
*
* Blah, blah, PieceTree#[], blah, blah, ...
*/

The 'PieceTree#[]' doesn't wind up as a reference to that method,
nikolai

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: minimalistic.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


AllaBest

12/15/2009 4:36:00 AM

0

On Dec 14, 6:56 pm, Lizz Holmans <di...@jackalope.demon.co.uk> wrote:
> On Mon, 14 Dec 2009 15:21:19 -0500, rwalker <rwal...@despammed.com>
> wrote:
>
> >I always got that sense from the lyrics, but heard it as "had a job
> >and got the sack."  Probably because jobber is not a common word in
> >American English.  
>
> More often heard as a 'jobbing plumber, or carpenter, or electrician'
> or whatever. An independent contractor, not tied to a company.

http://tinyurl.c...