Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Thu, 21 Nov 2013 09:50:30 +0100: > > Can you describe an implementation of a jump table mechanism using > > non-constant positions for its entries? > > If or if not jump tables are used is up to the compiler. A case _syntax_ > easily can be done with non-constants. Regarding the _language_ it's > nothing but an not necessary restriction to disallow them. Xou got examples to the opposite already, I'll refrain from commenting on this consequently. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
and cpp --help outputs ... -Xassembler Pass on to the assembler -Xpreprocessor Pass on to the preprocessor -XlinkerPass on to the linker ... ??? -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/20/2013 12:56 AM, Sieghard wrote: > You got a funny gcc. Mine doesn't do any preprocessing itself, it > needs to call an external program (named "cpp") for that purpose. > Where does your gcc come from? in fact this is seems to be wrong. Do cp -dumpecs and you will see that it's the (arch-depending) C compiler (supposedly "cpp" = "C plus plus" ), and not the (arch-independent) preprocessor. Thus I still suggest that the preprocessor is build in the "main executable" file called gcc ("gcc" = Gnu Compiler Collection"). Thus the preprocessor should be usable with all languages supported by gcc. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
CPP is PREprocessor :) Possibly with some entensions to provide very simple GCC/G++ functionality. Looks into its docs. Me especially consulted in them :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
gc = GNU C compiler g++ = GNU C++ compiler cpp = GNU C/C++ preprocessor -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Thursday 21 November 2013 12:11:44 Michael Schnell wrote: > On 11/21/2013 10:47 AM, Martin Schreiber wrote: > > I don't think so. for me 'case' <> 'else if'. > > Don't you like compiler magic ? :-) > Correct, I don't like compiler magic. :-) Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 03:25 PM, Ivanko B wrote: > gc = GNU C compiler > g++ = GNU C++ compiler > cpp = GNU C/C++ preprocessor > among other stuff cpp dumpspecs outputs *link_emulation: elf_i386 This does make no sense at all for a preprocessor -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 10:47 AM, Martin Schreiber wrote: > > I don't think so. for me 'case' <> 'else if'. > Don't you like compiler magic ? :-) -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
I see. But the definition I have in mind does not provide for taking multiple alternatives. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Thursday 21 November 2013 10:36:27 Michael Schnell wrote: > On 11/21/2013 10:06 AM, Martin Schreiber wrote: > > that semantic is independent of order of items. With variable case > > labels this is not possible. > > I don't understand what you mean by this. Could you give an example ? > " case i1 of 1: res:= 10; 2: res:= 20; end; case i1 of // same as above 2: res:= 20; 1: res:= 10; end; case i1 of 1: res:= 10; 1: res:= 20; //compiler error end; " " i1:= 1; i2:= 1; i3:= 1; case i1 of i2: res:= 10; i3: //no compiler error res:= 20; end; case i1 of i3: //no compiler error, different result res:= 20; i2: res:= 10; end; " [...] > > For me, the "case a of" syntax should be just an abbreviation of an > "else if" cascade of > > if a=x1 then begin > ... > end else if a = x2 then begin > ... > end else if a = x2 then begin > ... > else begin > end; > I don't think so. for me 'case' <> 'else if'. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 10:06 AM, Martin Schreiber wrote: > that semantic is independent of order of items. With variable case > labels this is not possible. I don't understand what you mean by this. Could you give an example ? Of course non-constants lead to additional logical problems. If a case label in fact is a function call, it could have side-effects that affect the selection of the other candidates. But this is true for many other syntax elements, as well. E.g. boolean operands are not evaluated if not necessary: function b: Boolean; function c: Boolean var a : Boolean a := b and c; Here, c might have a side effect but is not (necessarily) evaluated if the result of b is false. (At least this is how I understand most syntax definitions are done: evaluation from left to right.) This this user code is erroneous if c has side effects. Moreover in case of site effects the statements a := b and c. and a := c and b. are not equivalent. (Obviously again: This this user code is erroneous if b or c have side effects. ) Same of course holed for case: it is to be evaluated from left to right (i.e. from top to bottom). For me, the "case a of" syntax should be just an abbreviation of an "else if" cascade of if a=x1 then begin ... end else if a = x2 then begin ... end else if a = x2 then begin ... else begin end; In what low level operations this results is up to the compiler optimizations. (Martin: Happy coding ! :-) ) If there are side-effects within the evaluation of the decision-terms, is is obviously possible that some re not evaluated. The compiler needs to be able to rely on this fact and thus any user code that violates this rule needs to be considered as erroneous (see the boolean example above). Of course the order of the blocks might change the behavior. Either the compiler needs to take this into account, or it needs to be defined that any user code that relies on the order needs to be considered (and documented) as erroneous (see the boolean example above) -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Thursday 21 November 2013 09:50:30 Michael Schnell wrote: > On 11/21/2013 12:42 AM, Sieghard wrote: > > That's a rather silly statement. > > > > Can you describe an implementation of a jump table mechanism using > > non-constant positions for its entries? > > If or if not jump tables are used is up to the compiler. A case _syntax_ > easily can be done with non-constants. Regarding the _language_ it's > nothing but an not necessary restriction to disallow them. > IMO in 'case' statement it should be guaranteed that semantic is independent of order of items. With variable case labels this is not possible. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 12:42 AM, Sieghard wrote: > > That's a rather silly statement. > > Can you describe an implementation of a jump table mechanism using > non-constant positions for its entries? If or if not jump tables are used is up to the compiler. A case _syntax_ easily can be done with non-constants. Regarding the _language_ it's nothing but an not necessary restriction to disallow them. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 12:38 AM, Sieghard wrote: > How big is this "C preprocessor" ... The question is, how big is a full description :-) (without comments on how to use it :-) :-) :-) ). -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 12:38 AM, Sieghard wrote: > You might have called it with the wrong syntax... RecheckingI suppose the problem was that I mostly use cross-compiling, and here the name is not "cpp" but something like "xcpp" (which is funny as the proprocessor is arch-independent by design). -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 12:38 AM, Sieghard wrote: > these syntactic elements are _removed_ by the preprocessor. ... Thus the compiler will not see them. If it's a necessary element of the compiler's syntax, a coprocessor that always removes it can't be used. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/21/2013 12:12 AM, Sieghard wrote: > The elements of this "enumeration" are in every respect simple integer > constants in C, This is true. the effect is that they can used for other purposes than those associated with the type they are defined in. While this does not really harm, I would not vote for doing something like this in a new language design. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Wed, 20 Nov 2013 11:59:23 +0100: > On 11/19/2013 06:38 PM, Ivanko B wrote: > > "case" can. > > > > But "case: only accepts (compile time) contants in its labels so its > > usage is restricted. > An improved language could do away with this rather silly restriction That's a rather silly statement. Can you describe an implementation of a jump table mechanism using non-constant positions for its entries? -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Wed, 20 Nov 2013 11:45:56 +0100: > > _No_ language can make certain that a preprocessor cannot be used. > It can make use of the preprocessor syntax itself (e.g. requiring a # at > the start of a line for some purpose) No, it _cannot_, because these syntactic elements are _removed_ by the preprocessor. The (real) language processor doesn't "see" them at all. (BTW, the C preprocessor doesn't _require_ the "#" to be at the beginning of a line, just in front of its keyword - and it _may_ even be separated by whitespace from the one it _belongs_ to - weird.) > > _No_ language should depend on the use of a preprocessor. > Right. You _do_ say? ... > call cpp as a stand alone preprocessor and failed, but succeeding when You might have called it with the wrong syntax. "cpp --help" gives a long list of options and a description of how to use it. > > Well, what you write only asks for one single thing: "C". > I suppose for C this is documented somewhere. Did you find a > documentation for some Pascal dialect that contradicts the assumption > that it should work that way ? There are several things there that are syntactic errors in Pascal code, at least, of course, if not removed by some program processing the code prior to compiling it: - Pascal doesn't accept lone "#" characters - Pascal doesn't know the "\" line continuation convention - Pascal doesn't use "/*" and "*/" as comment delimiters - Pascal doesn't use "//" as a comment delimiter (although this was introduced as an extension by Delphi & FPC) (BTW, there are other styles for single line comments also, e.g. ADA uses "--", and some FORTHs use "\".) The remaining "requirements" you stated are very common for any programming language, even for common languages, at least such using the "latin" based writing system. > Of course the origin of the preprocessor is the needs of C programmers, > but as Martin will not be writing a new preprocessor, there is no way > but using same (if somebody might be in need for this). You could use _any_ program as a preprocessor, even a perl script or awk program, or even something written in Pascal. > > The C preprocessor has developed into a gargantuan monster never > > conceived to do what is was made to do. > > It is a perfect example on how an algorithm that can be defined in just > a few lines can be used to do very complex stuff. How big is this "C preprocessor" you're referring to? The one called "cpp" on my system is ove half a megabyte in size - machine code, that is. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Wed, 20 Nov 2013 12:05:31 +0100: > Objects are not "constant" but more like "static" classes. And in fact I never said that objects were constant. (They're not "static" either, as that's an undefined notion with Pascal.) All I said was that you could declare constants (or rather initialized variables) of object _type_. > they have not been removed but replaced by enhancing the "record" > concept to allow for what "objects" were. Happily it seems that Martin They have been officially announced being removed from Delphi. Their reintroduction as an extended variant of a "record" (what an object type always was, just a specialized form of) came quite some time later. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Wed, 20 Nov 2013 10:06:20 +0500: > hash code collisions > > SHA256 too ? Any code that uses fewer bits than the encoded item. Try prove the opposite, and when you succeed, write an article in some high ranking mathematical journal. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Wed, 20 Nov 2013 10:08:51 +0500: > C doesn't really _have_ enumerated _types_ > = > ? It has the "enum" type directly. Don't mix it with #DEFINEd constants. "enum" defines a sequence of symbolic constants, something C doesn't support natively like Pascal does. "Constants" defined via "#define" aren't symbolic constants, but - as even C acknowledges - "manifest" constants, as the compiler never sees the name, but only the value (or even expression) they're standing for. The names are removed from the code by the preprocessor. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Wed, 20 Nov 2013 11:29:01 +0100: > On 11/19/2013 09:31 PM, Sieghard wrote: > > C doesn't really _have_ enumerated _types_. > the compiler seems to think differently as he happily compiles: > > typedef enum claimUsage_e { LTE_CLAIM_SEM_MGT, > LTE_CLAIM_SEM_BASE, > LTE_VT_MGT, > LTE_VT_BASE } LTE_claimUsage_e; Yes, that's exactly what i described: define[ing] [] symbolic constants using a syntax looking ephemerally similar to an enumeration. The elements of this "enumeration" are in every respect simple integer constants in C, compatible to any other integer in the code. (C even allows assignments of specific values to such "enumeration elements", burning holes in the sequence. Yes, I know, this can be handy at times, but only if these identifiers are used as real integers, not as the values of a specific unique type.) -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Tue, Nov 19, 2013 at 10:12 PM, Sieghard wrote: > Hallo Marcos, > > Du schriebst am Tue, 19 Nov 2013 00:25:26 -0200: > >> > There's no "new ALIAS compiler parameter" neccessary. >> >> I know there is no new ALIAS parameter... So I'm proposing one. > > Read completely - there is no ALIAS parameter _neccessary_. Sorry, my mistake. >> Ok. >> So, please, explain how we can use __TWO__ units which have the >> __same name__ in the same project using their approach. > > They cannot. Why'd you want that? Because a 3rd lib could have an unit that have the same name that other 3rd lib or the same name my own unit -- as happened when Martin renamed classes.pas to mclasses.pas. > BTW, you could always build a secondary project, a library, say, using one > of them and include this into your main project. And anyway, this is won't fix my problem with 'm' prefix units (mclasses, etc) because mclasses unit is required in MSE. But this is only one example. > You split your project > into several units anyway, why not split it into several subprojects also, > especially when it is already so complex that you feel not being able to > avoid using the same name multiply for the same purpose? Sometimes this is good... but you have more work of course. You can create a library, eg Synapse, to encapsulate all classes/functions you will use in your project... but you need to reimplement all call for classes/functions creating a "new API" -- that already exists and work very well -- to use in your project ... why I would that?? > ... >> Using my approach... >> >> [project file] >> @lib1=/src/dir_1/* >> @lib2=/src/dir_2/* >> >> " >> unit Core; >> interface >> uses lib1.UnicodeUtils, lib2.UnicodeUtils; >> " >> Did you understand now? > > I did understand before. Now, how will you refer to some element in either > "unit" that has the same name, but different function? > Will you have to write "lib1.UnicodeUtils.ambigousname", forcing the > compiler to add a new level of qualification above the real unit names? Yes, like that, because this is the only way -- by design -- to do that in Pascal. But this is better than Java, for example, because if you have, in Java, two 'imports' that have the same Class, the compiler show an error "ambigous name", ie, you do not have this option... but Pascal does. Because that (too) is a good practice in Object Pascal -- IMO of course -- put your units always in last in queue because the compiler will look the identifiers (class, function, const, whatever) from last unit to the first. Example: unit1 -> procedure Foo; unit2 -> procedure Foo; unit3; interface uses unit1 {first}, unit2 {last}; [...] end; if you call Foo, the compiler will use unit2.Foo procedure. So, I want to use MY class/functions then I always put my units on the last. > Now, the contents of the project file show up in your source code, too. > Yes, you're right, but this is not my mistake. The compiler was designed so! BUT, if we have the ALIAS parameter like I proposed, this "real file names" could disappear from our sources. Every unit could be pointed using an alias parameter. >> > Anyway, we'll have to wait what will be implemented. >> >> I think so. Perhaps you understand the benefits. > > I don't see any. Fortunately, Martin Schreiber saw the benefits and he said he will implement this feature. ;-) -- Marcos Douglas -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
silly restriction == Possibly taken to aviod crossing ranges in run-time (not revealed at compile time). -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/20/2013 01:23 AM, Sieghard wrote: > They've been just resently removed from Delphi. They were called > "object"s, Objects are not "constant" but more like "static" classes. And in fact they have not been removed but replaced by enhancing the "record" concept to allow for what "objects" were. Happily it seems that Martin intends to get even one step further. > Well, you could invent yet another name again, of course... Lets see what Martin comes up with. :-) . I suppose he will find a way to allow for porting legacy Pascal programs that used the keywords "Record", "Object", and "class" by adding Type alias definitions in the source code. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/19/2013 06:38 PM, Ivanko B wrote: > "case" can. > > But "case: only accepts (compile time) contants in its labels so its > usage is restricted. An improved language could do away with this rather silly restriction -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/19/2013 03:53 PM, Martin Schreiber wrote: > "case" can. Having "elseif" looking like "case" is evil. I think the contrary: as well with "case" as with an "elseif" (or with pure fpc syntax: "end else if ... then begin") cascade only one of the multiple alternatives is taken (other then with if test1 then begin .. statementsequence1; end else begin ..statementsequence2 .. if test2 then begin statementsequence3; ...end else begin statementsequence4; ..end; ..statementsequence5; end; here multiple statement sequences are taken. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/19/2013 02:52 PM, Martin Schreiber wrote: > > It is planned to unify record, object and class in a single concept. Nice and consequently thought out ! -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/20/2013 12:56 AM, Sieghard wrote: > _No_ language can make certain that a preprocessor cannot be used. It can make use of the preprocessor syntax itself (e.g. requiring a # at the start of a line for some purpose) > _No_ language should depend on the use of a preprocessor. Right. > You got a funny gcc. Mine doesn't do any preprocessing itself, it > needs to call an external program (named "cpp") for that purpose. > Where does your gcc come from? Maybe I was fooled by my memory. I seem to remember that I once tried to call cpp as a stand alone preprocessor and failed, but succeeding when calling gcc with appropriate parameters. maybe I just have been silly... >> There are only very few things to be given: > Well, what you write only asks for one single thing: "C". I suppose for C this is documented somewhere. Did you find a documentation for some Pascal dialect that contradicts the assumption that it should work that way ? Of course the origin of the preprocessor is the needs of C programmers, but as Martin will not be writing a new preprocessor, there is no way but using same (if somebody might be in need for this). > The C preprocessor has developed into a gargantuan monster never > conceived to do what is was made to do. It is a perfect example on how an algorithm that can be defined in just a few lines can be used to do very complex stuff. > Pascal - especially the more modern dialects - doesn't need most of > the features of cpp. Right you are. > Nonetheless can it be of use sometimes to have some source file > processed to create the really compilable code. I can imagine a lot of other stuff. E.G. Martin does not want to implement "Generics". In ANSI C I do that what Generics are made for, by means of #define macros. Not nice, but doable. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/19/2013 09:31 PM, Sieghard wrote: > C doesn't really _have_ enumerated _types_. the compiler seems to think differently as he happily compiles: typedef enum claimUsage_e { LTE_CLAIM_SEM_MGT, LTE_CLAIM_SEM_BASE, LTE_VT_MGT, LTE_VT_BASE } LTE_claimUsage_e; -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
So, well have: --- Hmm, "THEN" here will may be needed for syntax ("IF" & "ELIF" are same level) consistence: - IF THEN ... ELIF THEN ... ELIF THEN ... ELIF THEN ... ELSE [THEN ?] ... END; -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
In the new (MSElang) syntax, there'll no BEGIN/END here. = The THEN too :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
C doesn't really _have_ enumerated _types_ = ? It has the "enum" type directly. Don't mix it with #DEFINEd constants. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
hash code collisions SHA256 too ? -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
END ELIF THEN BEGIN ... END = In the new (MSElang) syntax, there'll no BEGIN/END here. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Tue, 19 Nov 2013 13:07:41 +0100: > Of course (for speed) you should not always use a preprocessor. But the > language should take care that the use of the standard preprocessor (in _No_ language can make certain that a preprocessor cannot be used. _No_ language should depend on the use of a preprocessor. > fact called "gcc") is possible. You got a funny gcc. Mine doesn't do any preprocessing itself, it needs to call an external program (named "cpp") for that purpose. Where does your gcc come from? > There are only very few things to be given: Well, what you write only asks for one single thing: "C". We're _not_ discussing C here, do we? > Moreover gcc macros provides creation of " characters within a macro's The C preprocessor has developed into a gargantuan monster never conceived to do what is was made to do. The original preprocessor was just an afterthought add-on to allow for the use of (a kind of) symbolic constants with C. > code. This of course does not help for pascal sources, but onli > invalidates just this feature but not the general usability. Pascal - especially the more modern dialects - doesn't need most of the features of cpp. Nonetheless can it be of use sometimes to have some source file processed to create the really compilable code. In some respect, Martin's "i18n" facility is such a program, and it even calls the compiler itself (inverting gcc's method of calling the preprocessor from the compiler). -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Tue, 19 Nov 2013 13:16:36 +0100: > Of course you are right. Maybe inventing "constant objects" might be a > nice extension to Object pascal. They've been just resently removed from Delphi. They were called "object"s, and you _could_ indeed declare constant objects like that: TYPE Sometype = OBJECT ... END, { not really sure about the syntax here } CONST Something: Sometype = (...); > I understand this is to be able to remove the legacy "Objects" > (predecessor of "Class") types, by in fact a new construct "between" > record and class. You're talking about the "new" Delphi "record" type with "methods"? Well - it's not so new, it's just the old non-heap-resident object type by another name. Nothing really new here. > With that you would need neither record nor "Object" Well, you could invent yet another name again, of course... -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Marcos, Du schriebst am Tue, 19 Nov 2013 00:25:26 -0200: > > There's no "new ALIAS compiler parameter" neccessary. > > I know there is no new ALIAS parameter... So I'm proposing one. Read completely - there is no ALIAS parameter _neccessary_. > Ok. > So, please, explain how we can use __TWO__ units which have the > __same name__ in the same project using their approach. They cannot. Why'd you want that? BTW, you could always build a secondary project, a library, say, using one of them and include this into your main project. You split your project into several units anyway, why not split it into several subprojects also, especially when it is already so complex that you feel not being able to avoid using the same name multiply for the same purpose? ... > Using my approach... > > [project file] > @lib1=/src/dir_1/* > @lib2=/src/dir_2/* > > " > unit Core; > interface > uses lib1.UnicodeUtils, lib2.UnicodeUtils; > " > Did you understand now? I did understand before. Now, how will you refer to some element in either "unit" that has the same name, but different function? Will you have to write "lib1.UnicodeUtils.ambigousname", forcing the compiler to add a new level of qualification above the real unit names? Now, the contents of the project file show up in your source code, too. > > Anyway, we'll have to wait what will be implemented. > > I think so. Perhaps you understand the benefits. I don't see any. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Tue, 19 Nov 2013 12:45:18 +0100: > > FPC and MSElang do accept enumerated types. > > > C as well. :-) C doesn't really _have_ enumerated _types_. It has a means to define otherwise unavailable symbolic constants using a syntax looking ephemerally similar to an enumeration. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Tue, 19 Nov 2013 12:55:50 +0100: > How the "jump" is done is up to the compiler optimization not of the > syntax. Not quite - if you allow such complicated constructs, the compiler has to be complicated - and thus error prone - as well, because it has to be able to tell different requirements apart and handle them appropriately. Or it might be implemented in a simple, all comprising and ridiculously inefficient way. > For only a few cases it might use just do multiple compares, > For a sequence of numbers with not too many gaps it might do a direct > calculation > For a sequence of numbers with large gaps it might search a table of > constants and do a calculated jump afterwards. Yes, as does gcc, e.g. It's documented so, and they say so that you _know_ it isn't a "classical" jump table based case implementation. So you can simply forgo any possibly introduced inefficiencies by letting the _compiler_ do some guesswork as to what you might have wanted and can implement an if cascade or whatever you think appropriate yourself. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Martin, Du schriebst am Tue, 19 Nov 2013 07:05:56 +0100: > String case labels sometimes are handy and can be implemented by a hash > table for example. Certainly. With today's processor's addressing ranges, you might even be able to compile the hash result into an exhaustive jump table, which was the intention of a case implementation. But you will _still_ have to provide a way to deal with hash code collisions,because you cannot avoid them with certainty. BTW, what you showed as an example before was _not_ a "hash table", it was a simple linear token list which had to be scanned for each call to determine the case index. Of course, you could have the compiler do that, there's no limit to what it can include automatically on behalf of the code writer. Depends solely on how much effort you're willing to put in it. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Tue, 19 Nov 2013 13:30:22 +0500: > Also "ELSE IF" may spawn a lot of needless END whereas ELIF doesn't need That's wrong impression. Assuming any such construct requires a complete block constituted by a "begin"-"end" pair, they have exactly the same block structure: IF THEN BEGIN ... END ELSE IF THEN BEGIN ... END ELSE IF THEN BEGIN ... END ELSE IF THEN BEGIN ... END ELSE BEGIN ... END; vs. IF THEN BEGIN ... END ELIF THEN BEGIN ... END ELIF THEN BEGIN ... END ELIF THEN BEGIN ... END ELSE BEGIN ... END; The difference ist just three chracters per "EL[SE ]IF", nothing more and nothing less (as they say). -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
"case" can. But "case: only accepts (compile time) contants in its labels so its usage is restricted. can not guarantee that semantic is independent of order Only in case of crossing ranges. Which can be intended for a particular task BTW. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Tuesday 19 November 2013 15:31:26 Ivanko B wrote: > they show the nesting. > = > What about we don''t need nesting but instead switch independent > alternatives like CASE does ? > "elseif" can not guarantee that semantic is independent of order (do you mean that with "switch independent alternatives"?), "case" can. Having "elseif" looking like "case" is evil. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
they show the nesting. = What about we don''t need nesting but instead switch independent alternatives like CASE does ? -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Tuesday 19 November 2013 13:16:36 Michael Schnell wrote: > On 11/18/2013 10:53 PM, Sieghard wrote: > > IMHO it would make more sense to add syntax to allow for static "class"s > that are not "constructed" (on the heap) but just exist when a variable > for them is defined (either in global ram or on the local stack). > > With that you would need neither record nor "Object" > It is planned to unify record, object and class in a single concept. Please don't ask me how at the moment. ;-) Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
A problem is that gcc supposedly will not detect that the characters between single quotes are a string and should not be handled by the coprocessor. I did not yet research if/how this behavior can be (in fact gcc _can_ compile pascal code !) -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 10:53 PM, Sieghard wrote: > Now, how can you pass an object that's meant to be kept unaffected by > anything happening in the procedure or function? Well, yes, you simply > can't. Of course you are right. Maybe inventing "constant objects" might be a nice extension to Object pascal. > and thus a really unneccessary extension of an already well defined concept. I understand this is to be able to remove the legacy "Objects" (predecessor of "Class") types, by in fact a new construct "between" record and class. IMHO it would make more sense to add syntax to allow for static "class"s that are not "constructed" (on the heap) but just exist when a variable for them is defined (either in global ram or on the local stack). With that you would need neither record nor "Object" -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 09:23 PM, Sieghard wrote: > Though I doubt that there might be any sufficienty urgent need, can't > you _always_ use any external program for preprocessing any of your > source files, even be it manually before you compile it? You could > even use a program compiled with the compiler you intend to use. Of course (for speed) you should not always use a preprocessor. But the language should take care that the use of the standard preprocessor (in fact called "gcc") is possible. There are only very few things to be given: - The syntax should not ask for a line starting with (white space plus) # - The syntax should not ask for a line ending with \ - /* ... */ always is a multi-line content - // up to line end is a comment. - a blank character needs to be an allowed white space - line break is nothing but a white space Moreover gcc macros provides creation of " characters within a macro's code. This of course does not help for pascal sources, but onli invalidates just this feature but not the general usability. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 08:42 PM, Sieghard wrote: > Which defeats the intention of case as a _calculated_ selector statement. How the "jump" is done is up to the compiler optimization not of the syntax. For only a few cases it might use just do multiple compares, For a sequence of numbers with not too many gaps it might do a direct calculation For a sequence of numbers with large gaps it might search a table of constants and do a calculated jump afterwards. -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 05:26 PM, Martin Schreiber wrote: > On Monday 18 November 2013 17:16:03 Ivanko B wrote: >> Also CASE doesn't accept enumerated type. > FPC and MSElang do accept enumerated types. > C as well. :-) -Michael -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Tuesday 19 November 2013 09:30:22 Ivanko B wrote: > Also "ELSE IF" may spawn a lot of needless END whereas ELIF doesn't need > them. > They are not needless, they show the nesting. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
cmd => cmp -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Also "ELSE IF" may spawn a lot of needless END whereas ELIF doesn't need them. PS: Sure, in IA32/64 Assembler both ELSE IF and ELIF break into same ASM code like : cmd j [..] cmd j that's ELSE IF and ELIF equals because ASM intructions will excute sequently (for NOT j = ELSE) even for the ELIF case. But imagine other (built-in parallelism etc) CPU types... -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 18:48:26 Ivanko B wrote: > I do not accept your argument that elif is not nested. > == > IF & ELIFs can be swapped since independent (not nested). "ELSE IF" > can't since nested. > If one swaps "elseif" the program semantics can change (remember the "not inventor intended" example. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 20:42:23 Sieghard wrote: > Hallo Martin, > > Du schriebst am Mon, 18 Nov 2013 09:51:02 +0100: > > On Monday 18 November 2013 09:22:08 Ivanko B wrote: > > > Then use case: > > > = > > > It's INTEGER switch only, AFAIK. And compare expressions may > > > differentiate - the "case" can't provide that > > > > In FPC and possibly in MSElang strings work too. > > Which defeats the intention of case as a _calculated_ selector statement. > With anything but integers you have to resort to a "classical" comparison > cascade again. > String case labels sometimes are handy and can be implemented by a hash table for example. Martin -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Mon, Nov 18, 2013 at 6:31 PM, Sieghard wrote: > Hallo Marcos, > ... > >> > [units] >> > unit1=${projectdir}/level1/file1.pp >> > unit2=${projectdir}/level1/file2.pp > ... >> You're correct and that is exactly what I'm trying to explain! :-) >> So, the new ALIAS compiler parameter can be persisted in a config file > > There's no "new ALIAS compiler parameter" neccessary. I know there is no new ALIAS parameter... So I'm proposing one. >> unit group, package, lib or framework -- is used with other name. > > I don't think that the _UNIT_ should be "used with [an] other name", the > _UNIT_ should be named the same, just the file path can be specified > arbitrarily, and - maybe - the file name can be different from the unit > name (as was originally planned even by Borland already, but never > implemented - I don't know even whether FPC allows that). Ok. So, please, explain how we can use __TWO__ units which have the __same name__ in the same project using their approach. >> example I prefer to use: >> @Level1=${projectdir}/level1/*// the "@" is the sintaxe for an ALIAS >> >> Now I can use all units in ${projectdir}/level1/ like this: >> uses >> Level1.file1, Level1.file2; >> >> More productive, don't you think? > > No. You'll have to write more, have to keep the files together, have to > keep the naming consistent... Write more? Ok, how about this resume: a) One project b) Two units which have the same name, eg: /src/dir_1/UnicodeUtils.pp and /src/dir_2/UnicodeUtils.pp c) I need to use both units in a third unit, eg: /src/Core.pp So, how can I implement Core.pp to use both units above? " unit Core; interface uses UnicodeUtils... // WHERE " Using my approach... [project file] @lib1=/src/dir_1/* @lib2=/src/dir_2/* " unit Core; interface uses lib1.UnicodeUtils, lib2.UnicodeUtils; " Did you understand now? > > Anyway, we'll have to wait what will be implemented. I think so. Perhaps you understand the benefits. -- Marcos Douglas -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Tue, 19 Nov 2013 01:01:32 +0500: > They calculate differently : > > ELIF is "CondA || CondB || CondC || ..". > "ELSE IF" is smth like "!CondA && !(!CondB && !(!CondC && ..))". That's nonsense. Both constructs work exactly the same, and both don't have anything in common with a boolean expression, where all the terms are of equivalent importance. "ELSE IF" constructs are strictly sequential, while boolean expressions are logically "parallel", notwithstanding the fact that many programming languages do evaluation from left to right, except for parentheses. (Some may do evalation from right to left, and others determine the sequence even by other criteria.) -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Mon, 18 Nov 2013 12:22:57 +0100: > arithmetic. (In fact in Object Pascal any class reference is a pointer, > anyway) Yes, that's right, and has caused a lot of confusion among programmers using it. It makes the Pascal distinction between value and variable parameters useless, as effectively, _every_ object parameter becomes a variable parameter, even when passed by value. Now, how can you pass an object that's meant to be kept unaffected by anything happening in the procedure or function? Well, yes, you simply can't. > > And, you _cannot_ use this notation yourself for your self-declared > > pointer variables. It only works where so designed. > You may be right but this does not really make sense (Nowadays records > even can have "life" functions and thus are very similar to objects.) These '"life" functions' are just references to a table of predefined ones that are called indirectly if needed. Just as with objects - and thus a really unneccessary extension of an already well defined concept. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Mon, 18 Nov 2013 12:10:13 +0100: > result is as desired. If it is not, I consider some hand-optimization. > (but mostly it is rather perfect.) Weel... I cannot really speak for the PC code,,, > > And then, there are the myriad of compilers for special systems, > > non-PC CPUs, microcontrollers, ... but I _did_ some checking with different compilers (had to for hardware specific parts), and I was "not always" pleased, nor convinced that compilers had reached a similar level of competence as even an average human programmer. > Nowadays mostly based in the gnu engine. Thus the high-level > optimization (including the arch-independent stuff we have been talking > about here) is the same. Not at all. The quality of code generation, not even to mention code optimization, depends highly on the target system, especially the processor, of course, but sometimes even on ancilliary parts that are commonly used in conjunction with a specific processor. (Think of the common "application specific systems on a chip" ARM processors commonly are integrated into). The gnu compiler doesn't always shine here, too. ... > I'd be inclined to use the Oberon "with alias" but I'd never use the > highly ambiguous original Pascal syntax "naked" "with" syntax. Just the opposite of what I prefer. I like the extension of the scoping "metapher". -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 19:15:14 +0500: > It's strange that the very convinient EL[SE]IF was in the initial > PASCAL but Borland removed it for some reason in their Delphi. Give the exact position in or text from K. Jensen, N. Wirth, Pascal, user Manual and Report or a comparable language definition. I don't believe that. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 21:12:14 +0500: > if i = 0 then > writeln(0); > elif i > 0 then > writeln('>0'); > else > writeln('<0'); > end; That's _the_ classical example for the use of the "sign" function CASE sign (i) OF 0: WriteLn (0); 1: WriteLn ('>0'); -1: WriteLn ('<0'); END; -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Mon, 18 Nov 2013 11:42:33 +0100: > On 11/16/2013 07:53 AM, Martin Schreiber wrote: > > MSElang probably will not support macros. > While I agree that this is sensible, I vote for allowing to optionally > use the standard gnu "g" preprocessor if the need should occur. Though I doubt that there might be any sufficienty urgent need, can't you _always_ use any external program for preprocessing any of your source files, even be it manually before you compile it? You could even use a program compiled with the compiler you intend to use. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Martin, Du schriebst am Mon, 18 Nov 2013 17:53:30 +0100: > I do not accept your argument that elif is not nested. It *is* nested > therefore nesting should be visible in code structure. I am sure Sieghard > will proof the opposite. ;-) Tha opposite of _what_? This whole discussion is about something the _Pascal language_ doesn't care a bit about, the _formatting_. Pascal is a format free language, as is C, Perl, FORTH, PL/I, Algol, BASIC, FORTRAN, and quite a few others, nearly all common ones, with very few exceptions (Python one of them, and nearly all assemblers). But as to the _nesting_, how could anyone disprove a true statement? After all, the cascaded comparisons are dependend from another, a following one only executed if a previous one had the right outcome. Thus, there _is_ a level nesting inherent to this construct. Just how it's _written_ is mostly a programmer's decision of taste, and about taste... -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 16:46:30 +0500: > Case of float does not make sens as with float any test on equal does > not make sens. > === > ? These comparisions works well in IF. No, they don't. Try this: PROGRAM IFf; VAR N1, N2, N3: double; //single; BEGIN N1:= 2; N2:= sqrt (2); N3:= 2/sqrt (2); IF sqrt (N1) = N2 THEN WriteLn ('sqrt (N1) = sqrt (2)!') ELSE WriteLn ('There must be a floating point evaluation error...'); IF sqrt (N1) = N3 THEN WriteLn ('sqrt (N1) = 2/sqrt (2)') ELSE WriteLn ('There must be a floating point evaluation error...'); WriteLn ('sqrt (N1): ', sqrt (N1)); WriteLn ('N2:', N2); WriteLn ('N3:', N3); END. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Michael, Du schriebst am Mon, 18 Nov 2013 11:43:33 +0100: > On 11/16/2013 09:56 AM, Martin Schreiber wrote: > > I think program semantics should be independent of line breaks. > +1 > -Michael Pascal is _built_ on this premise, it's a format free language. What MSElang will be, we don't know, yet. Martin seems prone to keep it like Pascal, though. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 21:16:03 +0500: > Also CASE doesn't accept enumerated type. Though there's an workaround > - typecast to integer on CASEd variable and all matches. But it's > so-o-o ugly. What's _that_? PROGRAM enumcase; TYPE Test = (case1, case2, case3, case4); VAR Tester: Test; BEGIN FOR Tester:= case1 TO case4 DO CASE Tester OF case1: WriteLn ('Case 1'); case2: WriteLn ('Case 2'); case3: WriteLn ('Case 3'); case4: WriteLn ('Case 4'); END; END. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 16:51:58 +0500: > Possible syntax for float/numeric comparisions : > > "if f1 =n= f2" or "f1 f2" > where "n" is digits-after-dec_point > > :) Are you trying to reinvent COBOL, badly, sadly? :-( No, a modern PC processor _doesn't_ have that much in common with an ancient big iron IBM commercial computer. (That, BTW, _did_ calculate in BCD.) -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Martin, Du schriebst am Mon, 18 Nov 2013 09:51:02 +0100: > On Monday 18 November 2013 09:22:08 Ivanko B wrote: > > Then use case: > > = > > It's INTEGER switch only, AFAIK. And compare expressions may > > differentiate - the "case" can't provide that > > > In FPC and possibly in MSElang strings work too. Which defeats the intention of case as a _calculated_ selector statement. With anything but integers you have to resort to a "classical" comparison cascade again. (BTW, I wonder why ther wasn't the question yet whether you would support variable case labels... After all, you can use named constants, and what about typed constants? ;-> ) -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Marcos, Du schriebst am Sun, 17 Nov 2013 19:42:57 -0200: > Yes, but the paths are used only in command line to compiler -- did > you see the fpc binary call? -> fpc /src/synapse/* -alias synapse > The paths are not in sources... that's I meant. Ok, then I didn't get you quite right about that. > > [units] > > unit1=${projectdir}/level1/file1.pp > > unit2=${projectdir}/level1/file2.pp ... > You're correct and that is exactly what I'm trying to explain! :-) > So, the new ALIAS compiler parameter can be persisted in a config file There's no "new ALIAS compiler parameter" neccessary. > unit group, package, lib or framework -- is used with other name. I don't think that the _UNIT_ should be "used with [an] other name", the _UNIT_ should be named the same, just the file path can be specified arbitrarily, and - maybe - the file name can be different from the unit name (as was originally planned even by Borland already, but never implemented - I don't know even whether FPC allows that). > example I prefer to use: > @Level1=${projectdir}/level1/*// the "@" is the sintaxe for an ALIAS > > Now I can use all units in ${projectdir}/level1/ like this: > uses > Level1.file1, Level1.file2; > > More productive, don't you think? No. You'll have to write more, have to keep the files together, have to keep the naming consistent... Anyway, we'll have to wait what will be implemented. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
"ELSE IF" is smth like "!CondA && !(!CondB && !(!CondC && ..))". = If complier isn't smart enough to sipmplify these relations (possibly to "CondA || CondB || CondC || .." as the bolean logic rules) in compile time then it'll have less behefits from branch predictions etc CPU h/w techiques. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
They calculate differently : ELIF is "CondA || CondB || CondC || ..". "ELSE IF" is smth like "!CondA && !(!CondB && !(!CondC && ..))". -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Hallo Ivanko, Du schriebst am Mon, 18 Nov 2013 16:01:43 +0500: > as long as FPC has ":=" which definetely misses its brothers :) ":=" _DOES NOT_ _have_ "brothers", neither sisters - it is a construct meant to _actively_ display a directed operation which cannot be reversed: ASSIGNMENT. This notion has been completely disappeared from every programming language of C legacy, where misled programmers often even write an assignemnt as if it were a symmetrical operation. And what has prompted the C implementors to invent an unneccessary new operator for the truely symmetrical operation of comparison for equal. (You can exchange the operands of an "equal" comparison without altering the result, try that with an assignment!) > case of string. > === > And no CASE for (strangely discriminated) float/numeric types :) And Present a working and useful implementation, and I think not only Martin will accept it. It seems a bit like these constructs didn't really show sufficient value, so most programming language definitions put them aside. > "FOR .. BY " for them as well. That's a candidate for further consideration, indeed. The only slight problem is the use of the "step" value in conjunction with a notion of in which direction the index should count. There are 4 possibilties: 1.- step positive, direction up 2.- step positive, direction down 3.- step negative, direction up 4.- step negative, direction down 1. and 4. are certainly useful, but what about 2. and 3.? These latter ones are contradictory and should never occur with constant counting expressions, but what if variables are used? They need to be handled sensibly, and it has to be defined for all acceptible types what the language does then. After all, a _compiler_ is a program to create other programs. If it is faulty, the compiled programs will be faulty to, and so neither are useful. So, a compiler has to specified painstakingly thorough and precise, and implemented just so. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) --- Mit freundlichen Grüßen, S. Schicktanz --- -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
I do not accept your argument that elif is not nested. == IF & ELIFs can be swapped since independent (not nested). "ELSE IF" can't since nested. You still didn't rebut my argument that there is no indention between "if" and "end;" as in "case" statement. === My mind can't get it :) Too difficult to understand. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 17:25:28 Ivanko B wrote: > looks OK for me. > = > Sure, since EACH "elif" can be casted to "else if" :) > > But how about : > --- > if i=0 then > [..] > elif i <=0 > [..] > else > [..] > end; > " if i = 0 then [..] else if i <= 0 then [..] else [..] end; end; " I do not accept your argument that elif is not nested. It *is* nested therefore nesting should be visible in code structure. I am sure Sieghard will proof the opposite. ;-) You still didn't rebut my argument that there is no indention between "if" and "end;" as in "case" statement. Although that could be solved by " if i=0 then [..] elif i <=0 [..] else [..] end; " but there are 2 indents below "if" and consequently a simple "if then else" should be written as " if i=0 then [..] else [..] end; " Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
i < 0, sure. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
looks OK for me. = Sure, since EACH "elif" can be casted to "else if" :) But how about : --- if i=0 then [..] elif i <=0 [..] else [..] end; -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 17:16:03 Ivanko B wrote: > Also CASE doesn't accept enumerated type. FPC and MSElang do accept enumerated types. Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Also CASE doesn't accept enumerated type. Though there's an workaround - typecast to integer on CASEd variable and all matches. But it's so-o-o ugly. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 15:54:03 Ivanko B wrote: > Do You request real code from PODPISKA & ROZNITSA ? OK: > -- > procedure tmt1inputfo.findindexexec(const sender: TObject); > begin > with qryFindBase do begin > active:= false; active:= true; > if recordcount = 0 then begin > may_ok:= false; > showmessage('Данный индекс не найден для данных капмании, > каталога и типа подписки!','ИНДЕКС НЕ НАЙДЕН',200); > end else if recordcount > 1 then begin > may_ok:= false; > showmessage('Данный индекс имеет дубли для данных капмании, > каталога и типа подписки!','ОШИБКА В ДАННЫХ НА СЕРВЕРЕ',200); > end; > end; > end; " procedure tmt1inputfo.findindexexec(const sender: TObject); begin with qryFindBase do active:= false; active:= true; if recordcount = 0 then may_ok:= false; showmessage('Данный индекс не найден для данных капмании, каталога и типа подписки!','ИНДЕКС НЕ НАЙДЕН',200); else if recordcount > 1 then may_ok:= false; showmessage('Данный индекс имеет дубли для данных капмании, каталога и типа подписки!','ОШИБКА В ДАННЫХ НА СЕРВЕРЕ',200); end; end; end; " looks OK for me. > -- > REGEXPR > > class function TRegExpr.ParseModifiersStr (const AModifiers : > RegExprString; var AModifiersInt : integer) : boolean; > // !!! Be carefull - this is class function and must not use object > instance fields > var > i : integer; > IsOn : boolean; > Mask : integer; > begin > Result := true; > IsOn := true; > Mask := 0; // prevent compiler warning > for i := 1 to length (AModifiers) do >if AModifiers [i] = '-' > then IsOn := false > else begin > if Pos (AModifiers [i], 'iI') > 0 >then Mask := MaskModI > else if Pos (AModifiers [i], 'rR') > 0 >then Mask := MaskModR > else if Pos (AModifiers [i], 'sS') > 0 >then Mask := MaskModS > else if Pos (AModifiers [i], 'gG') > 0 >then Mask := MaskModG > else if Pos (AModifiers [i], 'mM') > 0 >then Mask := MaskModM > else if Pos (AModifiers [i], 'xX') > 0 >then Mask := MaskModX > else begin > Result := false; > EXIT; >end; I would use a table: " type maskmodty = (mm_i,mm_r,mm_s,mm_g,mm_m,mm_x); maskmodsty = set of maskmodty; const modifiers: array[maskmodty] of string = ( //mm_i,mm_r,mm_s,mm_g,mm_m,mm_x 'iI','rR','sS','gG','mM','xX'); var ch1: char; mod1: maskmodty; mask: maskmodsty; ... mask:= []; ch1:= amodifiers [i]; for mod1 in maskmodty do if pos(ch1,modifiers[mod1]) > 0 then mask:= [mod1]; break; end; end; > > SYNAPSE > > procedure CopyLinesFromStreamUntilBoundary(var APtr:PANSIChar; > AEtx:PANSIChar; ALines:TStrings; const ABoundary:ANSIString); > var > bol: PANSIChar; > lng: integer; > s:ANSIString; > BackStop: ANSIString; > eob1: PANSIChar; > eob2: PANSIChar; > begin > BackStop := '--'+ABoundary; > eob2 := nil; > // Copying until Boundary will be reached > while (APtr begin > SearchForLineBreak(APtr,AEtx,bol,lng); > SkipLineBreak(APtr,AEtx); > eob1 := MatchBoundary(bol,APtr,ABoundary); > if Assigned(eob1) then > eob2 := MatchLastBoundary(bol,AEtx,ABoundary); > if Assigned(eob2) then > begin > APtr := eob2; > Break; > end > else if Assigned(eob1) then > begin > APtr := eob1; > Break; > end > else > begin > SetString(s,bol,lng); > ALines.Add(s); > end; > end; > end; " while (APtr >if (value_len < tab_len) then begin > > s1:= avalues[i]; > setlength(ar1[i],1); // на выходе столбца будет однострочный массив > ar1[i][0]:= fitstring(s1,tab_len,alignment[i]); > >end else if (value_len = tab_len) then begin > > setlength(ar1[i],1); // на выходе столбца будет однострочный массив > ar1[i][0]:= avalues[i]; > >end else begin > [...] " if (value_len < tab_len) then s1:= avalues[i]; setlength(ar1[i],1); // на выходе столбца будет однострочный массив ar1[i][0]:= fitstring(s1,tab_len,alignment[i]); else if (value_len = tab_len) then setlength(ar1[i],1); // на выходе столбца будет однострочный массив ar1[i][0]:= avalues[i]; else ... end; end; " looks OK for me. > if editmode= em_edit then // редактирование записи // Проставить дату деактивации текущей записи рабочей таблицы // (дата активации новой записи) // редактированная запись деактивируется введенной // датой активации новой записи asql:= asql+'update '+ref_name+' set date_deactiv='+ fieldtosql(fldDateActiv)+' where '+id_field_name +'='+ curr_id+';'; // новое ID для текущ
Re: [MSEide-MSEgui-talk] MSElang, compound statements
a short form of "else if" = No. It does't deep into upper IF :) ELIF is especially good for checkin triple non-CASEable switches, in the new syntax : --- if i = 0 then writeln(0); elif i > 0 then writeln('>0'); else writeln('<0'); end; -- And for 2..3 alternatives of same hierarchy wher using cumbersome CASE would be unappropriate. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Mon, Nov 18, 2013 at 12:18 PM, Michael Schnell wrote: > On 11/18/2013 03:54 PM, Ivanko B wrote: >>if Pos (AModifiers [i], 'iI') > 0 >> then Mask := MaskModI > > For me, putting then in a new line under "if" is extremely confusing. +1 > moreover "elseif" seems to be just a short form of "else if" (but not > really that much shorter) +1 -- Marcos Douglas -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 03:54 PM, Ivanko B wrote: >if Pos (AModifiers [i], 'iI') > 0 > then Mask := MaskModI For me, putting then in a new line under "if" is extremely confusing. moreover "elseif" seems to be just a short form of "else if" (but not really that much shorter) -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Do You request real code from PODPISKA & ROZNITSA ? OK: -- procedure tmt1inputfo.findindexexec(const sender: TObject); begin with qryFindBase do begin active:= false; active:= true; if recordcount = 0 then begin may_ok:= false; showmessage('Данный индекс не найден для данных капмании, каталога и типа подписки!','ИНДЕКС НЕ НАЙДЕН',200); end else if recordcount > 1 then begin may_ok:= false; showmessage('Данный индекс имеет дубли для данных капмании, каталога и типа подписки!','ОШИБКА В ДАННЫХ НА СЕРВЕРЕ',200); end; end; end; -- REGEXPR class function TRegExpr.ParseModifiersStr (const AModifiers : RegExprString; var AModifiersInt : integer) : boolean; // !!! Be carefull - this is class function and must not use object instance fields var i : integer; IsOn : boolean; Mask : integer; begin Result := true; IsOn := true; Mask := 0; // prevent compiler warning for i := 1 to length (AModifiers) do if AModifiers [i] = '-' then IsOn := false else begin if Pos (AModifiers [i], 'iI') > 0 then Mask := MaskModI else if Pos (AModifiers [i], 'rR') > 0 then Mask := MaskModR else if Pos (AModifiers [i], 'sS') > 0 then Mask := MaskModS else if Pos (AModifiers [i], 'gG') > 0 then Mask := MaskModG else if Pos (AModifiers [i], 'mM') > 0 then Mask := MaskModM else if Pos (AModifiers [i], 'xX') > 0 then Mask := MaskModX else begin Result := false; EXIT; end; if IsOn then AModifiersInt := AModifiersInt or Mask else AModifiersInt := AModifiersInt and not Mask; end; end; { of function TRegExpr.ParseModifiersStr SYNAPSE procedure CopyLinesFromStreamUntilBoundary(var APtr:PANSIChar; AEtx:PANSIChar; ALines:TStrings; const ABoundary:ANSIString); var bol: PANSIChar; lng: integer; s:ANSIString; BackStop: ANSIString; eob1: PANSIChar; eob2: PANSIChar; begin BackStop := '--'+ABoundary; eob2 := nil; // Copying until Boundary will be reached while (APtr nil then begin // меняется пароль логина if seOldPassword.value <> dmmainmo.fldOperPassword.asmsestring then showmessage('Прежний пароль введен неправильно!') else begin b1:= true; dmmainmo.dbpasswchange(seNew.value); end; end else if loginfo <> nil then begin // меняется пароль входа в программу if not md5digestcomp(pswencode(seOldPassword.value),pswread('admin.psw')) then showmessage('Прежний пароль введен неправильно!') else begin b1:= true; pswwrite('admin.psw',pswencode(seNew.value)); end; end; --- procedure clean4notfound( const fieldread, fieldwrite: tfield; const local_idx_num: integer = -1 ); var bm: bookmarkdataty{string}; fld: tfield; sr,sw: widestring; begin if (fieldread = nil) or (fieldwrite = nil) then exit; if not ((fieldread.dataset.active) and (fieldwrite.dataset.active)) then exit; with fieldread, (dataset as tmsesqlquery) do begin if (fieldwrite.dataset.state in [dsBrowse,dsInactive]) then exit; if fieldread is tmselongintfield then begin if local_idx_num >= 0 then begin if not indexlocal[local_idx_num].find( [fieldwrite.asinteger],[],bm, false,false,true ) then begin fieldwrite.clear; end; end; end else if fieldread is tmsestringfield then begin if local_idx_num >= 0 then begin if not indexlocal[local_idx_num].find( [fieldwrite.asmsestring],[],bm, false,false,true ) then begin fieldwrite.clear; end; end; end; end; end; -- function GetPSStream( adir: msestring = ''): ttextstream; begin if adir = '' then outfile:= gettempfilename(gettempdir ,'msepsout') else if finddir(adir) then outfile:= gettempfilename(adir,'msepsout') else raise exception.create('GetPSStream: failed to access the output directory ' + adir); result:= ttextstream.create(outfile,fm_create); end; procedure tform5edifo.monthbegsettext(
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 15:15:14 Ivanko B wrote: > It's strange that the very convinient EL[SE]IF was in the initial > PASCAL but Borland removed it for some reason in their Delphi. > Martin, EL[SE]IF are HIGHLY required :) > None of your arguments convinced me and you did not show real code, sorry. Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
It's strange that the very convinient EL[SE]IF was in the initial PASCAL but Borland removed it for some reason in their Delphi. Martin, EL[SE]IF are HIGHLY required :) -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 11:17:42 Ivanko B wrote: > Since CASE is a partial case (a convinience syntax entention) of ELIF > then rather CASE should be removed then ELIF :) > I disagree. Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 10:28:31 Ivanko B wrote: > *are* nested > === > They're nested not more than branches of CASE are nested :) > I disagree. Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On Monday 18 November 2013 10:27:34 Ivanko B wrote: > strings > == > Not strings but chars (convertable to integer). And "case" doesn't > allow changing/extending comprare expressions for conditions. > Please try it. > mostlikely does not what the inventor intended. ;-) > == > First matched branch will be executed :) The same as "if else" but > with much shorted and more readable syntax. I disagree. Martin -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 12:46 PM, Ivanko B wrote: > Case of float does not make sens as with float any test on equal does > not make sens. > === > ? These comparisions works well in IF. Sadly, It is allowed in "if" but it does not make any sense and is the cause of ample problems programming beginners are hit by. -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Possible syntax for float/numeric comparisions : "if f1 =n= f2" or "f1 f2" where "n" is digits-after-dec_point :) -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
Case of float does not make sens as with float any test on equal does not make sens. === ? These comparisions works well in IF. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 12:10 PM, Ivanko B wrote: > I use such indentation: > === > Only the cunny indentation allows to have the code be readable. It's > an workaround :) I used half-indentation with "else" because to me it is absolutely logical (both parts are subsumed below the "if" block), Same is true for the alternatives in a "case" block. Thus when I found the first decent use for the "else if", it was completely obvious that the result looks very similar to "case". > > as C has "fall through" switch cases. > === > Not so bad, BTW. I did use it now and again, but it does force you to pay attention to even when you never intend to use it, which I do think is a problem for many. -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/18/2013 12:01 PM, Ivanko B wrote: And no CASE for (strangely discriminated) float Case of float does not make sens as with float any test on equal does not make sens. Of course it does make sense to invent a case testing ranges for float. But this would be a completely new baby. -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/15/2013 10:17 PM, Sieghard wrote: > You _do_ know that pointer errors make for most of the scurity > problems of software overall, relegating any other errors to distant > follow-up places? Correct but this is explicit pointer arithmetic (which in fact is very common for C programmers). For replacing "with" you would not do pointer arithmetic. (In fact in Object Pascal any class reference is a pointer, anyway) > And, you _cannot_ use this notation yourself for your self-declared > pointer variables. It only works where so designed. You may be right but this does not really make sense (Nowadays records even can have "life" functions and thus are very similar to objects.) mseLang could do away with such unnecessary differentiation. (IMHO an even better idea then introducing the Oberon "with" syntax). -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/15/2013 09:48 PM, Sieghard wrote: > Not even neccessarily. It could be a programmer error, e.g. such that > he forgot to declare a variable "volatile", Right. This just hit me some days ago when porting a program from an ancient "MRI" C compiler to a modern gnu compiler. But even here, the Compiler issued a "gimple" error message and declined to compile my source code (because the function was called from within the same source code file, the compiler would not have been able to detect the problem when calling the function from another file.) Unfortunately it was really hard to find out that an erroneous volatile definition was the cause of the nasty "gimple" error. > Optimization can even change the program flow without creating > errors, e.g. by more aggressive inlining of functions - remember, a > function declared "inline" _needs not_ to be always inserted literally > by the compiler. That is true. But source code that is affected by that needs to be regarded as erroneous. -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
I use such indentation: === Only the cunny indentation allows to have the code be readable. It's an workaround :) as C has "fall through" switch cases. === Not so bad, BTW. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
On 11/15/2013 09:40 PM, Sieghard wrote: > And yet, there are - probabely still just as many - C programmers that > don't trust their compilers a bit. Including myself. But my way of handling this is doing "nice" code and in critical cases after compiling checking the resulting ASM code it the result is as desired. If it is not, I consider some hand-optimization. (but mostly it is rather perfect.) > And then, there are the myriad of compilers for special systems, > non-PC CPUs, microcontrollers, Nowadays mostly based in the gnu engine. Thus the high-level optimization (including the arch-independent stuff we have been talking about here) is the same. > even hardware devices - you know there's a version of C++ for FPGA > programming? e.g -> http://en.wikipedia.org/wiki/Impulse_C > Err - agree with _what_? To not use it? I'd be inclined to use the Oberon "with alias" but I'd never use the highly ambiguous original Pascal syntax "naked" "with" syntax. -Michael -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Re: [MSEide-MSEgui-talk] MSElang, compound statements
think this is a very clear and handsome syntax. === as long as FPC has ":=" which definetely misses its brothers :) case of string. === And no CASE for (strangely discriminated) float/numeric types :) And "FOR .. BY " for them as well. -- DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk ___ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk