Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: INLINE
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 15 Topic 3817 of 4325
Post > Topic >>

Re: INLINE

by Krishna Myneni <krishnamyneni@[EMAIL PROTECTED] > Mar 9, 2008 at 02:09 PM

Albert van der Horst wrote:
> In article <2008Mar9.115712@[EMAIL PROTECTED]
>,
> Anton Ertl <anton@[EMAIL PROTECTED]
> wrote:
>> Krishna Myneni <krishnamyneni@[EMAIL PROTECTED]
> writes:
>>> OFF THIS TOPIC: it would be nice if Forth 200x would standardize a
keyword for
>>> denoting inline words, e.g.
>>>
>>> : CELL- [ 1 CELLS ] LITERAL - ;  inline
>>>
>>> A Forth implementation could choose to ignore the keyword, or to give
the marked
>>> word appropriate compile time behavior.
>> If you think it's worth the effort, go ahead and make an RfD.  This
>> one should not be too controversial.  I am sure you will find a
>> committee member willing to help you when you need help.
> 
> What would it mean? An optimizing compiler inlines that code
> anyway. In my embedded renesas Forth I would just do : INLINE ;
> and get over it.
> 

The word INLINE gives control to the programmer, rather than the compiler,
on 
forcing the word to be used inline. An optimizing compiler may or may not
inline 
the word, perhaps depending on optimization level (as with gcc). Allowing
the 
programmer to override the optimizer is a useful feature.

> It reminds me of the ``register'' keyword in C. If you have a
non-optimising
> compiler it is ignored. If you have a smart optimising compiler it is
ignored.
> If you have a dumb optimising compiler you force it to do non-optimal
> optimising.
> 

This is the reason why the "volatile" keyword exists in C. It forces the 
optimizing compiler to reload a variable from memory, rather than keep it
in a 
register always. Again, it's an issue of programmer control vs blindly
using the 
compiler's optimizations. Anyone who has ever written an interrupt service

routine realizes the need for such control.

>> - anton
> 
> Groetjes Albert
> 
> --

Krishna
 




 15 Posts in Topic:
FSL array indexing
Krishna Myneni <krishn  2008-03-08 12:04:11 
Re: FSL array indexing
"C. G. Montgomery&qu  2008-03-08 17:38:51 
Re: FSL array indexing
Krishna Myneni <krishn  2008-03-08 19:35:05 
Re: FSL array indexing
"C. G. Montgomery&qu  2008-03-09 03:18:48 
Re: FSL array indexing
Krishna Myneni <krishn  2008-03-08 22:27:23 
INLINE (was: FSL array indexing)
anton@[EMAIL PROTECTED]   2008-03-09 10:57:12 
Re: INLINE (was: FSL array indexing)
Albert van der Horst <  2008-03-09 14:56:11 
Re: INLINE
Krishna Myneni <krishn  2008-03-09 14:09:17 
Re: INLINE
Andrew Haley <andrew29  2008-03-10 21:46:50 
Re: INLINE
Bruce McFarling <agila  2008-03-10 15:51:06 
Re: INLINE
mhx@[EMAIL PROTECTED] (M  2008-03-11 00:01:55 
Re: INLINE
Bruce McFarling <agila  2008-03-10 17:09:57 
Re: FSL array indexing
m_l_g3@[EMAIL PROTECTED]   2008-03-12 10:46:19 
Re: FSL array indexing
Krishna Myneni <krishn  2008-03-12 19:56:08 
Re: FSL array indexing
"C. G. Montgomery&qu  2008-03-09 17:24:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 15:22:08 CST 2008.