[futurebasic] Re: [FB] usr and def considered harmful

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2009 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Tue, 6 Oct 2009 02:44:24 -0400
I don't see how they can overly complicate the editor or FBtoC that  
much, seeing how they have worked ok for years, and even with FBtoC.  
Def might should be for Def fns in code, not helper functions, but  
Usr was not that abstract at all.

If you are going to remove them,   then perhaps instead of a black  
and white approach of making them all generic,  to avoid collision  
with existing code and to make it easy to know you are calling a  
handy runtime function, maintaining some manner of intuitiveness,  at  
least consider to rename any changed items to Fn  
UsrSomeHandyRuntimeSomethingOrOther, with a Usr prefix.

rc

On Sep 27, 2009, at 5:02 AM, Robert Purves wrote:

> The FB runtime supplies many utility functions, strangely split  
> into three classes by the required calling syntax, for example:
>
> x   = usr Handle2Btn( ... )
> err = usr ScanFolder( ... )
> h   = usr ReplaceResource( ... )
>
> def WindowReposition( ... )
> def SetButtonData( ... )
> def DisposeH( ... )
>
> c = fn FindFBBtnControl( ... )
> s = fn ButtonTextString$( ... )
> i = fn DynamicNextElement( ... )
>
> The FBtoC team sees no reason to continue the split, which  
> complicates both the editor and FBtoC. We plan to eliminate usr and  
> def so that fn is used for all three.
> In the next release (5.4.1) of FB, usr and def will be optional,  
> with fn being allowed as a replacement. Warnings will be issued  
> that usr and def are deprecated <http://en.wikipedia.org/wiki/ 
> Deprecate>. In some later release, usr and def calls to runtime  
> utilities will be dropped altogether.
>
> The following uses of the keyword def will be retained:
> def fn Xxx( ... )           // prototype
> def fn Xxx( ... ) = expr    // 1-line function
> def fn Xxx( ... ) using fourByteInt // indirect via pointer
> def LPrint
> def open [=] expr
> def Page
> def tab [=] expr
> def using [=] expr
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic- 
> unsubscribe@...
>