Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22084

Re: What's wrong with arguments.callee ?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <14451970.gaMzNCkPz3@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Wed, 20 Nov 2013 22:27:20 +0100
User-Agent KNode/4.10.5
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: What's wrong with arguments.callee ?
Newsgroups comp.lang.javascript
References <708973f8-8cc4-409f-b763-f1ef0d455b58@l43g2000hsh.googlegroups.com> <c95a09a4-4230-4ec1-a65c-648422284e94@googlegroups.com>
MIME-Version 1.0
Lines 73
NNTP-Posting-Date 20 Nov 2013 22:27:21 CET
NNTP-Posting-Host 1a035fbe.newsspool2.arcor-online.net
X-Trace DXC=WjP?FG1oIIL2jYf>V4L0gLA9EHlD;3YcB4Fo<]lROoRA8kF<OcfhCOKRLRX_FVNK>NDZm8W4\YJNLYUVHKH;GI^GFJmoc`^B06FY`@QL_5M61C
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:22084

Show key headers only | View raw


Archenoth wrote:

> On Sunday, September 14, 2008 3:18:03 AM UTC-6, Jorge wrote:
             ^^^^^^^^^^^^^^^^^^
Good morning.

>> Why is it listed here :
>> 
>> http://www.crockford.com/javascript/recommend.html
>> 
>> under "deprecation" ?
>> 
>> Without it, how is an anonymous function() going to call itself
>> (recursively) ?
>> 
>> I use to write timers like this :
>> 
>> setTimeout( function () {
>>   (...)
>>   setTimeout( arguments.callee, ms );
>> }, ms );
>> 
>> How am I suppossed to do that without arguments.callee ?
>> 
>> Thanks,
>> --
>> Jorge.
> 
> You can have an inline named function like so:
> 
>> setTimeout( function loop() {
>>   (...)
>>   setTimeout( loop, ms );
>> }, ms );
> 
> Early versions of the language never allowed for named functions as
> expressions, which made anonymous recursion impossible. So, to allow for
> this sort of recursion, arguments.callee was born as a bit of a quick-fix.

Wishful thinking.

If “the language” is supposed to be Netscape JavaScript (not the only 
ECMAScript implementation that is on-topic here), then know that 
arguments.callee was introduced with JavaScript 1.2 in Netscape Navigator 
4.0 –

<http://faqintosh.com/risorse/web/netscape/CoreReferenceJS14/function.htm>

– and so were function expressions, *both* anonymous and named (AFAIK the 
proof is in the pudding only; should it be possible to make the ECMAScript 
Support Matrix 2 that much backwards-compatible, those test results will be 
contained in there).

> But now that that has been remedied,

arguments.callee still works, but not in strict mode.  It is *that* design 
decision that is being discussed in this thread.

> there is little reason to use it. (Aside from taking up a name in the
> namespace within the current scope.)
> 
> I had many uses for arguments.callee too, but upon further investigation,
> it seems as though inline named functions solve all of the problems I had
> before, and allow for some other nifty little constructs.

Please read the whole thread before replying late (especially when it is 
*that* old).  TIA.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: What's wrong with arguments.callee ? Archenoth <gir7590@gmail.com> - 2013-11-20 11:02 -0800
  Re: What's wrong with arguments.callee ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-20 22:27 +0100

csiph-web