|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
Implicit Typing would be nice to haveIt would sure be nice if we had a command like this:
C_REAL("r@") and C_TEXT("@_t") which would implicitly type all variables whose names began with, or that ended with a particular string. 30+ years ago, I could easily do this in Fortran: IMPLICIT INTEGER (i,j,k) George Tiller 911 East A Street Brunswick, Maryland 21716 ********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
Re: Implicit Typing would be nice to haveOn 4 Nov 2009, at 04:10, George Tiller wrote: > It would sure be nice if we had a command like this: > > C_REAL("r@") I think 4D decided that if your a fortran programmer, you won't be needing variable names longer than 1 letter anyway and so haven't implemented this feature :) For more info see http://www.pbm.com/~lindahl/real.programmers.html Peter ********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
RE: Implicit Typing would be nice to haveAt the summit, Miyako demoed a macro that would run thru a method and type the variables for you. I believe his variables were denoted by the _Type naming convention but the macro could be changed if some other naming convention was used. It isn't what you are asking but it can help for typing variables in a method which is the result you want. > Date: Tue, 3 Nov 2009 22:10:16 -0500 > From: gtiller_erols@... > To: 4D_Tech@... > CC: > Subject: Implicit Typing would be nice to have > > It would sure be nice if we had a command like this: > > C_REAL("r@") > > and > > C_TEXT("@_t") > > which would implicitly type all variables whose names began with, or that > ended with a particular string. > > 30+ years ago, I could easily do this in Fortran: > > IMPLICIT INTEGER (i,j,k) > > > > George Tiller > 911 East A Street > Brunswick, Maryland 21716 > > > ********************************************************************** > Get the speed and power of 4D v11 SQL > before upgrade prices increase - http://www.4d.com > > > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4D.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4D_Tech-Unsubscribe@... > ********************************************************************** _________________________________________________________________ Bing brings you maps, menus, and reviews organized in one place. http://www.bing.com/search?q=restaurants&form=MFESRP&publ=WLHMTAG&crea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
|
|
|
|
|
|
Re: Implicit Typing would be nice to haveI think I uploaded a macro some time ago to this list that typed vars.
However, it relied on QFree, so would have to be slightly rewritten for the available regex implementations (assuming you're talking about v11). 2009/11/5 George Tiller <gtiller_erols@...>: > That macro would certainly be a help in many situations, thanks Garri. > > > On 11/4/09 5:59 AM, garri_ogata@... wrote: > >>At the summit, Miyako demoed a macro that would run thru a method and type >>the variables for you. I believe his variables were denoted by the _Type >>naming convention but the macro could be changed if some other naming >>convention was used. It isn't what you are asking but it can help for >>typing variables in a method which is the result you want. >> >>> Date: Tue, 3 Nov 2009 22:10:16 -0500 >>> From: gtiller_erols@... >>> To: 4D_Tech@... >>> CC: >>> Subject: Implicit Typing would be nice to have >>> >>> It would sure be nice if we had a command like this: >>> >>> C_REAL("r@") >>> >>> and >>> >>> C_TEXT("@_t") >>> >>> which would implicitly type all variables whose names began with, or that >>> ended with a particular string. >>> >>> 30+ years ago, I could easily do this in Fortran: >>> >>> IMPLICIT INTEGER (i,j,k) > > > > George Tiller > 911 East A Street > Brunswick, Maryland 21716 > > > ********************************************************************** > Get the speed and power of 4D v11 SQL > before upgrade prices increase - http://www.4d.com > > > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4D.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4D_Tech-Unsubscribe@... > ********************************************************************** > -- Owen Watson ********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
Re: Implicit Typing would be nice to haveWhats wrong with the compiler directive "Type the variables" ?
-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "The butterfly does not count years, but moments, and therefore has enough time." - Rabindranath Tagore ********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
|
|
|
|
|
|
Re: Implicit Typing would be nice to haveHow about this:
1. Rename variables in Insider to suit your new conventions. 2. Compile, and have the compiler export the symbol table. 3. Copy/paste the variables portion of the .SYM file into a 4D COMPILER_Variables method 4. Edit types as appropriate in the COMPILER_Variables method. 5. Compile again. This will flag up lots of errors. 6. Edit the program to make the errors go away. 7. If there are no more variables generating errors and/or to be renamed, you're done. Otherwise, go to step 1. Would that work? David Dancy Sydney, Australia 2009/11/5 George Tiller <gtiller_erols@...>: > On 11/4/09 7:00 PM, sujit.au@... wrote: > >>Whats wrong with the compiler directive "Type the variables" ? >> > This is a fine directive, but it types the variables according to their > use, and the program I'm working on uses the same variable in multiple > ways: > > v327:=v123+v219+... > > and then v327 is displayed on a form. > > Since the program has always been running interpreted, 4D helpfully > coerces the variable into changing types when needed. Now it needs to be > compiled, and many, many programming errors need to be fixed. > > I want to change the name of the variable to something more meaningful in > 4D Insider, and then assign the variable type using a command and have > the compiler flag all the places where the assigned type is violated by > the use of the var, so I can find them and change the variable name to > something different in those cases and have the Compiler assign a > variable type using my set of typing rules. The easiest way is to have > the compiler type the vars correctly is to be able to assign some rules > that will preserve the correct typing, such as: > > ..._r for REAL > ..._d for DATE > ..._t for TEXT, etc. > > Then, any use of the var that violates the imposed typing will generate > an error so that I can fix the code. > > This would be easier than looking at every place that the variable occurs > in code or on a form. With just a few vars, this would be no problem, but > I'm up against thousands of vars with names like v345, vBug744, vPace660, > etc. > > > > George Tiller > 911 East A Street > Brunswick, Maryland 21716 > Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
|
|
|
|
|
Re: Implicit Typing would be nice to haveCool. We have had to do some stuff like that in the past and the
symbol table file is pretty handy. David Dancy Sydney, Australia 2009/11/5 George Tiller <gtiller_erols@...>: > Yes, it would work, and it's a very good idea, thanks! ********************************************************************** Get the speed and power of 4D v11 SQL before upgrade prices increase - http://www.4d.com 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4D.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4D_Tech-Unsubscribe@... ********************************************************************** |
| Free embeddable forum powered by Nabble | Forum Help |