ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tuft Muller" <...@online.no>
Subject RE: JavaDoc generation
Date Tue, 29 Jan 2002 17:50:46 GMT
Dave,

With my extremely poor javascript capabilites, I just spent 3 hours finding
that out(!). Thanx anyway. Btw, you're entitled to send untestet code
snippets as long as you include the non-tested disclaimer - just as you did!

Thanx a lot for the code-snippet and the idea of using JavaScript. It works
according to my original intention now.

--

Thomas


| -----Original Message-----
| From: Herman, Dave [mailto:dherman@intrado.com]
| Sent: 29 January 2002 16:54
| To: 'Ant Users List'
| Subject: RE: JavaDoc generation
|
|
| Yep, that was the problem: I forgot the "var" in the for-loop. To fix the
| example I sent, change this:
|
|     for (i = 0; i < subs.length; i++)
|     {
|         ...
|     }
|
| to this:
|
|     for (var i = 0; i < subs.length; i++)
|     {
|         ...
|     }
|
| I suppose I ought to test out my suggestions before I make them. :)
|
| Dave
|
| > -----Original Message-----
| > From: "Schaible, Jörg" [mailto:Joerg.Schaible@gft.com]
| > Sent: Tuesday, January 29, 2002 7:08 AM
| > To: Ant Users List
| > Subject: RE: JavaDoc generation
| >
| >
| > Hi Thomas,
| >
| > >I've never used BSF or Rhino before, nor have I done any
| > >serious Javascript
| > >programming, but it seems strange to me that recursion is
| > not properly
| > >supported.
| >
| > ahem, JavaScript supports recursion very well and Rhino is
| > (one of) the best
| > JavaScript implementations. Sadly, most people treat this
| > language as quick
| > and dirty HTML hacker's tool and fail to recognize the language's
| > specialities (JS has even OOP support).
| >
| > Concerning recursion most people fail to use variable scope
| > in JS properly:
| >
| > function fac(x)
| > {
| > 	y = x;
| > 	if (x > 1)
| > 		y = fac( x-1 ) * y;
| > 	return y;
| > }
| >
| > This function will return always 1! 'y' is defined as global variable!
| >
| > function fac(x)
| > {
| > 	var y = x;
| > 	if (x > 1)
| > 		y = fac( x-1 ) * y;
| > 	return y;
| > }
| >
| > This will work as expected! 'y' is in local scope.
| >
| > Regards,
| > Jörg
| >
| > --
| > To unsubscribe, e-mail:
| > <mailto:ant-user-unsubscribe@jakarta.apache.org>
| > For additional commands, e-mail:
| > <mailto:ant-user-help@jakarta.apache.org>
| >
|
| --
| To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
| For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
|
|



*************************************************************************
Copyright ERA Technology Ltd. 2001. (www.era.co.uk). All rights reserved. 
Confidential. No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message