![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Enough preprocessor features and you too will find that you've gone and forked off a whole new programming language. ....which is exactly what Ross has done, but it doesn't help the rest |
#2
| |||
| |||
|
#3
| ||||||
| ||||||
|
|
CRT "Your account is ":$!WHO It seems to me that you are in fact looking for a meta-language that would cover the flavor specific details. In fact the issue has been tackled already in some respect by jBASE and probably others, by allowing the developer to enforce specific flavor emulations. |
|
Any sort of language, natural or otherwise, evolves, and sooner or later a new dialect will appear and all that standardization goes to waste. What is a great standard for some may be seen as illogical by others. Evolution is the engine of progress and is defined by change. |
|
The standards that resist the test of time are usually atomic ones, or axiomatic if you will. For example the IF-THEN-ELSE construct is common to many if not all programming languages. On the other hand even thou at physical level all bytes look the same, data storage and access concepts is as diverse as the languages themselves. To get to the point, a meta-language on top of BASIC may induce an even larger behavioral diversity for the target application and it may also induce a performance hit and a maintenance nightmare. |
|
In my opinion, beyond enforcing emulations as jBASE does, the platform specific INCLUDEs is the way to go. |
|
I guess no vendor would push for total standardization. If all MVs are the same, what would be the incentive to buy one MV versus another ? |
|
Unlike manufacturing, for software you have the initial investment and then you can multiply it at no cost therefore the cost/price incentive is diluted. Changing the topic, I would like to see a repository of differences between flavors and a repository of bugs for each flavor. Lucian |

#4
| |||
| |||
|
|
In my opinion, beyond enforcing emulations as jBASE does, the platform specific INCLUDEs is the way to go. |
#5
| |||
| |||
|
|
Lucian wrote: In my opinion, beyond enforcing emulations as jBASE does, the platform specific INCLUDEs is the way to go. I just came across a good example of why Includes aren't any more ideal than custom syntax via a pre-compiler. 01 NOT.EMPTY = 1 02 * EMPTY.VAR is not assigned 03 * Check empty var: 04 IF NOT(ASSIGNED(EMPTY.VAR)) THEN EMPTY.VAR = 1 For line 04, Unidata has its own unique syntax (regardless of ECLTYPE or BASICTYPE): 04 IF UNASSIGNED(EMPTY.VAR) THEN EMPTY.VAR = 1 Line 4 simply won't compile for the wrong platform. Maybe we can pass the var to a subroutine and check externally: 04 CALL CHECK.ASSIGNED(EMPTY.VAR,VAR.IS EMPTY) 05 IF VAR.IS.EMPTY THEN EMPTY.VAR = 1 For most functions this would work well, but for this specific problem the Call will generate a Var Unassigned error on most platforms, destroying the transparency. So how about the Include? Well, Including code that won't compile is no different than having it in-line. The only solution that I can see for this one and many others with completely incompatible syntax is to use a pre-compiler with the following syntax: Option 1) #D3 IF NOT(ASSIGNED(EMPTY.VAR)) THEN EMPTY.VAR = 1 #UD IF UNASSIGNED(EMPTY.VAR) THEN EMPTY.VAR = 1 Option 2) IF $!UNASSIGNED(EMPTY.VAR)!$ THEN EMPTY.VAR = 1 The funky codes (the "$!" stuff) would get extracted by the pre-compiler, replaced with code appropriate for the platform, then put through the real compiler on the target platform. In order to generate platform-specific code, you need to know which platform you're on and/or what the target platform is. Ironically, I hit this example in my code that determines the platform - it's sort of a Catch 22 when the code you need to determine the platform is itself subject to platform-specific issues. I'm not looking for a solution to this ASSIGNED problem. If someone suggests a way for ASSIGNED to work on Unidata, that will be one problem solved but something else will come up tomorrow. Personally, I can get around these problems easily by doing some hard coding here and there, and adding a comment to myself to come back to fix it later. That's the way we'd do it any other time. I just thought I'd share a decent example of the problem so you know why I'm thinking along these lines. T |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |