realbasic-nug
[Top] [All Lists]

Re: Anyone know if the RB compiler calculates numeric expressions involv

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Anyone know if the RB compiler calculates numeric expressions involving only literals and CONSTANTS at compile time.
From: William Squires <wsquires at satx dot rr dot com>
Date: Sat, 30 Jun 2007 20:15:47 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BAY107-DAV13C8F68D4CB7783D6D14B6930A0 at phx dot gbl> <9BF94954-921A-4F8B-AF42-807359F21BE1 at declareSub dot com>
On Jun 27, 2007, at 11:16 AM, Charles Yeomans wrote:

>
> On Jun 27, 2007, at 12:07 PM, Daniel Stenning wrote:
>
>> Say you have a method:
>>
>> Function myFunc() As Integer
>>     return 1 + MYCONSTANT
>> End Function
>>
>>
>> Does anyone know if the RB compiler figures out that the return
>> expression
>> can be replaced by a numeric result calculated once at compile time ?
>>
>> ( ie performs a compile time optimisation )
>>
>
> Try it and see :)
>
How would you know, short of disassembling the code? :) Or see if  
there's a preference panel for optimizations (for Constant  
Folding)... :)

> Charles Yeomans
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>