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 > Pascal Ansi -iso > Re: function as...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 16 Topic 187 of 215
Post > Topic >>

Re: function as a pointer.

by CBFalconer <cbfalconer@[EMAIL PROTECTED] > Dec 20, 2006 at 11:26 PM

Chris Burrows wrote:
> "scott moore" <nospam@[EMAIL PROTECTED]
> wrote in message
>
>> This aside, let's go back to WWWD (What Would Wirth Do). The basis
>> of Wirth design philosophy is that we don't include language
>> features unless there is no other way to easily accomplish the
>> same result without it.
> 
> I agree with your observations. However, it is not necessary to try
> to second-guess WWWD to back these up. Instead, consider WDWD (What
> Did Wirth Do).
> 
> 1. In the function examples in the Pascal User Manual and Re****t,
> local variables are used, even when strictly unnecessary, and
> assigned to the function result immediately prior to termination.

Unnecessary.  The following example works quite nicely:

FUNCTION itworked(param : integer) : boolean;

   BEGIN 
   itworked := false; (* default *)
   IF param > threshold1 THEN itworked := true
   ELSE IF param > 0 THEN itworked := itworked(10 * param + 10);
   END;

-- 
Chuck F (cbfalconer at maineline dot net)
   Available for consulting/tem****ary embedded and systems.
   <http://cbfalconer.home.att.net>
 




 16 Posts in Topic:
function as a pointer.
"steelman22" &l  2006-12-13 12:50:35 
Re: function as a pointer.
"Chris Burrows"  2006-12-14 12:18:26 
Re: function as a pointer.
CBFalconer <cbfalconer  2006-12-13 21:45:35 
Re: function as a pointer.
"Chris Burrows"  2006-12-14 14:50:51 
Re: function as a pointer.
John Reagan <john.reag  2006-12-14 15:10:25 
Re: function as a pointer.
CBFalconer <cbfalconer  2006-12-13 20:22:40 
Re: function as a pointer.
Waldek Hebisch <hebisc  2006-12-14 19:24:48 
Re: function as a pointer.
John Reagan <john.reag  2006-12-15 16:49:02 
Re: function as a pointer.
scott moore <nospam@[E  2006-12-16 09:55:57 
Re: function as a pointer.
John Reagan <john.reag  2006-12-20 00:45:08 
Re: function as a pointer.
scott moore <nospam@[E  2006-12-20 10:13:07 
Re: function as a pointer.
"Chris Burrows"  2006-12-21 09:55:38 
Re: function as a pointer.
CBFalconer <cbfalconer  2006-12-20 23:26:40 
Re: function as a pointer.
John Reagan <john.reag  2007-01-02 15:21:12 
Re: function as a pointer.
scott moore <nospam@[E  2007-01-02 07:59:18 
Re: Standards Committees (was: function as a pointer).
"Chris Burrows"  2007-01-03 10:01:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Jul 26 0:26:20 CDT 2008.