Re: [MSEide-MSEgui-talk] MSElang, zero based strings and arrays

2013-11-06 Thread Michael Schnell
On 11/06/2013 11:56 AM, Ivanko B wrote: Now approx 100% of WWW are utf8, most DB setups are UTF8, most text editors are UTF8, most LINUX installations are UTF8.. While UTF8 is a perfect code for storing and transport, IMHO it is not at all perfect for being handled by complex software. Here

[MSEide-MSEgui-talk] some opinions

2013-11-06 Thread Michael Schnell
(Copied from the FPC mailing list where it had erroneously been posted) IMHO this theme is complex enough to start another mailing list instead of discussion it here. There already has been a (IMHO very interesting) discussion in the German Lazarus forum that in fact does have an mse

[MSEide-MSEgui-talk] some opinions

2013-11-06 Thread Michael Schnell
(Copied from the FPC mailing list where it had erroneously been posted) IMHO this theme is complex enough to start another mailing list instead of discussion it here. There already has been a (IMHO very interesting) discussion in the German Lazarus forum that in fact does have an mse

Re: [MSEide-MSEgui-talk] MSElang, zero based strings and arrays

2013-11-06 Thread Michael Schnell
On 11/06/2013 12:49 PM, Ivanko B wrote: Sure, provided that all ansistring-like operations are correct for its surrogates. Codepoints 2^15 cause a problem with index of a string (as with codepoints 2^7 in UTF8). This needs to be documented appropriately. using the index not explicitly but

Re: [MSEide-MSEgui-talk] some opinions

2013-11-06 Thread Michael Schnell
On 11/06/2013 12:57 PM, Ivanko B wrote: Probably needs a wider discussion even flaming debates - on FreePascal.Ru etc... We are not discussing free Pascal here, so I don't get the meaning of this ?!?!? -Michael --

Re: [MSEide-MSEgui-talk] MSElang, zero based strings and arrays

2013-11-06 Thread Michael Schnell
On 11/06/2013 01:31 PM, Ivanko B wrote: Which shouldn't be ignored avoided :) ?? Once we contact with aliens (and their alphabets) then UTF8 or UTF16 become only choices. ?? -Michael -- November

Re: [MSEide-MSEgui-talk] some opinions

2013-11-06 Thread Michael Schnell
On 11/06/2013 01:40 PM, Martin Schreiber wrote: On Wednesday 06 November 2013 11:27:58 Michael Schnell wrote: [...] strings It is planned to implement bytestring, bytestring[maxlength], string8, string16 and string32. string8 is utf-8 encoded, string16 utf-16, string32 ucs4. string8

Re: [MSEide-MSEgui-talk] some opinions

2013-11-06 Thread Michael Schnell
On 11/06/2013 01:45 PM, Ivanko B wrote: I vote for adding Syntax for parallel processing == It can mainly be useful for parallel-aware languages like Haskell (which prevents form creating state-machine applications badly compatible with paralleizing ). Did you

Re: [MSEide-MSEgui-talk] some opinions

2013-11-07 Thread Michael Schnell
On 11/06/2013 01:40 PM, Martin Schreiber wrote: string8, string16 and string32. string8 is utf-8 encoded, string16 utf-16, string32 ucs4. This ask for three versions of RTL provided classes like TStringlist (and in fact TStrings) , so that the user who decides to use one of the three

Re: [MSEide-MSEgui-talk] some opinions

2013-11-07 Thread Michael Schnell
On 11/07/2013 09:42 AM, Martin Schreiber wrote: MSEgui doesn't use tstringlist, there is a tmsestringdatalist I don't know msegui well enough to see what this exactly means. Delphi and Lazarus and most programs done with these tools use TStrings all over the place (including, but not

Re: [MSEide-MSEgui-talk] some opinions

2013-11-07 Thread Michael Schnell
On 11/07/2013 12:56 PM, Martin Schreiber wrote: There possibly will be no TStrings in MSElang RTL. As providing TStrings similar to the different types of same in D7, DXE and Lazarus/fpc without creating sever ambiguity is close to impossible, this is OK. If a user wants to port a program he

Re: [MSEide-MSEgui-talk] MSElang, subrange type necessary?

2013-11-08 Thread Michael Schnell
On 11/08/2013 07:00 AM, Martin Schreiber wrote: Do we need subrange types? I understand subranges are only useful for defining arrays with same as index. But as you want to disallow whatever based arrays, I doubt array[TSubrange] makes much sense. In fact a subrange is a special case of an

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-08 Thread Michael Schnell
On 11/08/2013 11:30 AM, Ivanko B wrote: Ranging for integers may also help to build not yet hardware suported types, Somewhat similar, but IMHO by far not as useful as Records defining bit-field variables. -Michael --

Re: [MSEide-MSEgui-talk] MSElang, should it use Algol 68 syntax?

2013-11-11 Thread Michael Schnell
On 11/10/2013 02:33 PM, Sieghard wrote: Don't try. There was _never_ a complete implementation of this language around for all the time being, although the foremost computer scientists of the time worked on these compilers (way back) then. Martin does like a decent challenge :-) :-) .

Re: [MSEide-MSEgui-talk] MSElang, subrange type necessary?

2013-11-11 Thread Michael Schnell
On 11/11/2013 05:35 AM, Ivanko B wrote: You require theater seat numbers to start at 0 for each row as well? +1 (If the count of seats is 9 it would start with 00, of course.) Sine we'll have bit counts etc starting from 0 then it's more consistent to count everything numeric from 0 as well

Re: [MSEide-MSEgui-talk] MSElang, subrange type necessary?

2013-11-11 Thread Michael Schnell
On 11/08/2013 11:26 PM, Sieghard wrote: TYPE MonthDay = 1..31; WeekDay = 1..7; CharBits = 5..9; { for serial interfaces } Not useful? IMHO Only really useful if you go on Type WorkingHours = Array [MonthDay] of Integer; or similar. -Michael

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/08/2013 05:32 PM, Martin Schreiber wrote: Or ord8, ord16, ord32, ord64, int8, int16, int32, int64? So why invent new names instead of using the really well known names such as uint8_t, int16_t -Michael --

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/09/2013 08:27 PM, Sieghard wrote: C-ish type IMHO C-ish stuff only should be avoided if there is not already a really decent alternative in well known Pascal dialects. In fact C-ish naming _should_ be used if the most well known (GNU) C dialect or the most well known C-Libraries (glibc

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/08/2013 07:46 PM, Martin Schreiber wrote: One probably would write Register = bitpacked RECORD Field_1: $..$007f; Field_2: $..$0003; Field_3: $..$001f; Field_4: $..$0001; Field_5:

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/11/2013 10:53 AM, Martin Schreiber wrote: Because if there is a u for unsigned there must be a s for signed (orthogonality). But int is already signed (as Sieghard pointed out) so sint is bad. While I do see you point, IMHO this is trading strictness vs readability, and thus a matter of

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/11/2013 10:34 AM, Ivanko B wrote: Why not something like bitpacked RECORD Filed_1: integer: 7; Filed_2: integer: 2; Filed_3: integer: 5; Filed_4: integer: 1; Filed_5: integer: 1; end === For non-2^N ranging. I don't

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-11 Thread Michael Schnell
On 11/11/2013 12:15 PM, Martin Schreiber wrote: card32, int32 is based on Pascal types and unambiguous too. cardinal, integer - recommended type, card, int - size of the CPU registers. Yep. As said: mater of taste. So it's up to you. -Michael

Re: [MSEide-MSEgui-talk] MSElang, should it use Algol 68 syntax?

2013-11-12 Thread Michael Schnell
On 11/11/2013 11:03 PM, Sieghard wrote: t _even_ C has block delimiters ({ and }), because they're _needed_ by any notation that does _not_ restrict formatting the code. In fact I _always_ use begin ... end ( or in C } ... { ) with if and loop instructions (as I do not like the ambiguity

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-12 Thread Michael Schnell
On 11/11/2013 11:00 AM, Ivanko B wrote: That signedness isn't more than just a old (and not obvious) assumption. Thus -1 is greater than 1 as the representation of -1 is all bits set ? -Michael -- November Webinars for

Re: [MSEide-MSEgui-talk] MSElang, should it use Algol 68 syntax?

2013-11-12 Thread Michael Schnell
On 11/12/2013 10:13 AM, Martin Schreiber wrote: In Pascal (and in MSElang) ';' does not terminate but separate a statement. Exactly. (Different from C.) Empty statements are possible - OK. Thus my (c-influenced) style is acceptable. -Michael

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-13 Thread Michael Schnell
On 11/12/2013 04:45 PM, Martin Schreiber wrote: with r: rec1 do I decently hate with due to the ambiguity it imposes: it actively but temporarily hides other names without notion (nested with's are even more malicious). So I _never_ use it I vote for dropping it :-) -Michael

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-13 Thread Michael Schnell
On 11/13/2013 12:21 PM, Martin Schreiber wrote: Never mind. with is very important in order to speed up array of record addressing and the like. I disagree. With is just a way to save some typing. speeding the runtime execution is up to the compiler optimization (it might decide to use a

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-13 Thread Michael Schnell
On 11/13/2013 02:27 PM, Martin Schreiber wrote: therefore int64: 2; is invalid, i I don't agree that this is sensible, but it's up to you. how would you define a bitpacked record filed with two bits that is intended to be handled as a signed integer ? ty tr = ??; r : tr; i: int32 r.x2

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-13 Thread Michael Schnell
On 11/13/2013 02:30 PM, Martin Schreiber wrote: No. For exactly that purpose we have the with statement. Haha ! intermediate variables are much more versatile than with (very useful even for other stuff than for records) and impose much less ambiguity as they only hide their own name (which

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-13 Thread Michael Schnell
On 11/13/2013 02:37 PM, Martin Schreiber wrote: There is no with itself in MSElang, there is 'with' ALIAS ':' REFERENCE 'do' STATEMENTS 'end' I need to take a closer look. -Michael -- DreamFactory - Open Source REST

[MSEide-MSEgui-talk] mseLang: Zero Based strings

2013-11-13 Thread Michael Schnell
if Strings are zero based pos() will issue a 0 if he second string starts with the first one. Supposedly it will issue -1 if there is no match. While I do like this behavior, it is very incompatible with any existing Pascal dialect, where you do if pos() = 0 to check if a string is contained

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-13 Thread Michael Schnell
On 11/13/2013 05:19 PM, Martin Schreiber wrote: type recordty = bitpacked record x2: -2 to 1; x3: -2 to 1: 2; //same as above x4: 0 to 5: 4; //subrange in 4 bits end; While I don't like to be forced to calculate the range manually from the intended bit count, this of

Re: [MSEide-MSEgui-talk] mseLang: Zero Based strings

2013-11-13 Thread Michael Schnell
On 11/13/2013 09:33 PM, Sieghard wrote: You could also decide to make pos take a return variable parameter for the position, as this would nearly always be neccessary. Its return value would then be a boolean, indicating whether the substring was found. You might provide an overloaded

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-14 Thread Michael Schnell
On 11/14/2013 09:16 AM, Michael Schnell wrote: x6: unsigned : 2; This syntax would allow for x7: unsigned : 1024; It would be a nice and consequent to provide arbitrary precision integer arithmetic :-) . -Michael

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-15 Thread Michael Schnell
On 11/15/2013 01:03 AM, Sieghard wrote: And then, it's a little bit funny to read a statement against source code optimization from a C programmer, when it is often an expressed concern by such to keep their source code as optimized for their compiler as possible... :-) This seems a

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-15 Thread Michael Schnell
On 11/14/2013 09:49 PM, Sieghard wrote: For debugging you can define a lower Optimization level. You can d that, of course. Often, then, the reason for debugging goes away. Optimization levels are only allowed to affect execution speed and code size. If the result of a function is

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-15 Thread Michael Schnell
On 11/14/2013 09:28 PM, Sieghard wrote: It might not be very neccessary if these types aren't compatible among each other. Range checking has to be done only on coercion then, i.e. when assigning a value cast from a - any - different type. I understand that Martin is (IMHO) correctly assuming

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-15 Thread Michael Schnell
On 11/14/2013 08:12 AM, Martin Schreiber wrote: I don't like it. Or with reserved words: type boolty = max: 8; //bool8 cardty = 0 to max: 8;//card8 intty = smin to smax: 8; //int8 charty = #max: 8;//char8 floatty = -.max to .max: 64; //flo64

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-15 Thread Michael Schnell
On 11/15/2013 10:06 AM, Martin Schreiber wrote: How do you suggest one should solve the Pascal with problem that it is possible that an additional field in the with record can hide already used names in existing with statements with that record? +1 IMHO there is no decent way to handle the

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-15 Thread Michael Schnell
On 11/15/2013 02:00 PM, Martin Schreiber wrote: Why? Do you never work with variant records? No. There and with records generally with is a good aid to structure the code. Anyway: sorry for not being clear enough. I meant the with keyword for denoting the record the fields denoted afterward

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-15 Thread Michael Schnell
On 11/15/2013 02:08 PM, Martin Schreiber wrote: How do you define char8/char16/char32 float32/float64 then if you don't want to be forced to write the range? Neither a bit limitation nor a range makes sense for floats. Bits: you would need to specify a bit count as well for the Mantissa and

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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. -Michael

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
On 11/16/2013 09:56 AM, Martin Schreiber wrote: I think program semantics should be independent of line breaks. +1 -Michael -- DreamFactory - Open Source REST JSON Services for HTML5 Native Apps OAuth, Users, Roles,

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
On 11/16/2013 02:55 PM, Ivanko B wrote: what is *=? ??? IMHO it's a good thing that fpc does support +=, -=, *= ... I think this is a very clear and handsome syntax. (Another extension I do like about fpc is case of string.) -Michael

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
On 11/17/2013 06:46 PM, Martin Schreiber wrote: Do you have a real example where elseif is much better than nested ifs I use such indentation: if a=b then begin ..x := y; .end else if c = d then begin ..z := w; .end else if f = g then begin ..s := t; end; with that an elseif keyword is not

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-18 Thread Michael Schnell
On 11/15/2013 08:28 PM, Sieghard wrote: _What_ bit count should it use if you use it within an expression where operands of different I already did mention this. The obvious definition is - neglect the size of the variable to store the result in - for constants use the smallest bit count

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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.

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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),

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-18 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-19 Thread Michael Schnell
On 11/18/2013 10:51 PM, Sieghard wrote: Hallo Michael, Could you please keep sufficient context so even a casual reader can surmise what was meant? Thank you. Nope. That is what message threads do. So you say a single bit can be signed? Yep. The highest order bit in a number in the 2's

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-19 Thread Michael Schnell
On 11/18/2013 11:03 PM, Sieghard wrote: Even if it is larger than any of the other operands? Yep. That is how it usually is done. Extend or sign-extend after the operation if the target is larger, truncate if it is smaller. Size extend always at runtime? Yep (If necessary): Adding leading

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-19 Thread Michael Schnell
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 --

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-19 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-19 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-19 Thread Michael Schnell
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.

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-19 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-20 Thread Michael Schnell
On 11/19/2013 09:20 PM, Sieghard wrote: Yep. The highest order bit in a number in the 2's complement encoding is the sign bit. Ok, let's look at it this way. Then, what's the value of this lone sign bit? This is obvious. Take a look at the predecessor of zero as done by the algorithm any

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-20 Thread Michael Schnell
On 11/20/2013 01:23 AM, Sieghard wrote: They've been just resently removed from Delphi. They were called objects, 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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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.

Re: [MSEide-MSEgui-talk] MSElang, fixsize numeric base types

2013-11-21 Thread Michael Schnell
On 11/21/2013 01:03 AM, Sieghard wrote: the values you assign to the symbols (bit patterns, in this case) are just convention. And don't matter as long as no calculation can return a result outside of the base set. Yep. And for casting them to bigger types (also implicitly when doing

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-21 Thread Michael Schnell
On 11/21/2013 07:31 AM, Martin Schreiber wrote: As usual I still don't understand. procedure strfunc(): msestring; begin return 'The string result'; end; Slight Advantage of Result: procedure strfunc(x: Boolean): msestring; begin Result := 'The string result'; if x then

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-21 Thread Michael Schnell
On 11/20/2013 11:04 PM, Marcos Douglas wrote: No, no, no...please! :( I know that you want to make a language more ortogonal but exceptions could exist! If you do not have parameters, why I need use this '()'? This introdices is a well known ambiguity in Delphi, that in fpc is resolved (when

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, objects

2013-11-22 Thread Michael Schnell
While I think, private, protected and public are enough visibility complexity (omitting published and all the new fancy stuff invented by Embarcadero), I supposed abstract is one of the concepts that should be added to the description. -Michael

Re: [MSEide-MSEgui-talk] MSElang, objects

2013-11-22 Thread Michael Schnell
On 11/22/2013 09:09 AM, Michael Schnell wrote: I supposed abstract is one of the concepts that should be added to the description. + reintroduce (will non-heap objects have virtual methods ?) BTW.: IMO method is a more appropriate new combined name for procedure/function than sub

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-22 Thread Michael Schnell
On 11/21/2013 05:41 PM, Ivanko B wrote: end:= result; == It means one more memory copying opetation which can be quite expensive in case of large data (dynarrays,..). Why does everybody suspect that Martin is a bad compiler designer that is unable to do decent

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
and cpp --help outputs ... -Xassembler argPass arg on to the assembler -Xpreprocessor arg Pass arg on to the preprocessor -Xlinker arg Pass arg on to the linker ... ??? -Michael -- Shape

Re: [MSEide-MSEgui-talk] MSElang, compound statements

2013-11-21 Thread Michael Schnell
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

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-22 Thread Michael Schnell
On 11/21/2013 08:24 PM, Ivanko B wrote: The 'sub' keyword is just ugly, not an error. ;-) = Feels less ugly than function for non-returning procedure for returning :) IMHO. If inventing a new keyword replacing as well function as procedure it should be Method as same

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-22 Thread Michael Schnell
On 11/21/2013 10:50 PM, Sieghard wrote: Hallo Michael, Du schriebst am Thu, 21 Nov 2013 10:10:29 +0100: Using a procedure name without () can be either a call to this procedure or denote the address of this procedure to be moved onto a procedure variable. It will be what was defined for it

Re: [MSEide-MSEgui-talk] MSElang, objects

2013-11-22 Thread Michael Schnell
On 11/22/2013 10:54 AM, Martin Schreiber wrote: Doesn't 'method' imply that there is an instace pointer additional to the code address? For me this would be a method of object. (But of course this is a matter of taste.) -Michael

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/22/2013 06:25 PM, August Oktobar wrote: What about multiple return values (e.g. in Golang)? ... In effect making function results out variables. With that you also could vote for deamons (the previous value of the variable to be set by a function can be seen within a function, in

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/22/2013 06:52 PM, Ivanko B wrote: How looks the call of the function? == Smth like in Python: (var1,var2):= MultResFunc(arg1,arg2); In Python, the (var1,var2) syntax has other effects on it's own, as well IIRC, in a language I used some 100 years ago (called PLZ

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/25/2013 09:36 AM, Michael Schnell wrote: With that you also could vote for deamons (the previous value of the variable to be set by a function can be seen within a function, in effect making function results var variables. Sorry, this was incorrect. Daemons in this context

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/24/2013 08:44 AM, Martin Schreiber wrote: On Saturday 23 November 2013 21:23:11 Ivanko B wrote: := 'The string result: '+avalue; = := instead of exposing Result ? Looks interesting. It is mandatory and allowed as last statement only. I also think this is a nice idea.

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/24/2013 02:48 PM, Marcos Douglas wrote: But if 'return' exists, why I will use ':= value'??? Two ways to do the same? ...like in C ? return lvalue; might be a synonym for := lrvalue; return; -Michael -- Shape

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
.. or := lrvalue; exit; -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

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/24/2013 05:21 PM, Marcos Douglas wrote: I disagree that a program without 'return' or 'exit' uses a more safe coding style. +1; you often would need to use break and/or clumsy constructs using flags or even goto. IMHO, each of this makes the code less readable. -Michael

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/24/2013 05:41 PM, Ivanko B wrote: Also how about BREAK(nesting_level) NEXT(nesting_level) ? Some languages provide that and one is quite handy. Nesting levels are just horrible, as you will regularly forget to change them appropriately when you add a new nesting level to your code.

Re: [MSEide-MSEgui-talk] MSElang, procedures and functions

2013-11-25 Thread Michael Schnell
On 11/25/2013 10:43 AM, Martin Schreiber wrote: You and Marcos probably never had to debug code with common necessary cleanup at procedure end and a deeply nested sometimes triggered 'exit' which bypassed the cleanup accidentally. It happened several times to me... I do see the argument

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-12 Thread Michael Schnell
+1 (even seemingly not a very common language restriction) -Michael -- Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-16 Thread Michael Schnell
On 12/16/2013 02:29 PM, Ivanko B wrote: unsigned := signed ? Here, user know what he/she wants to get No he does not. (absolute value of the signed). Even you don't :-) . If you do unsigned := signed; you get the correct positive value if positive. But if it is negative you'll get

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-16 Thread Michael Schnell
On 12/16/2013 02:52 PM, Ivanko B wrote: But if it is negative you'll get maxunsigned + value + 1, as === Really it should do internally smth like : unsigned:= ABS(signed) -1 This would be different to any known language and much slower. -Michael

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-17 Thread Michael Schnell
On 12/16/2013 03:58 PM, Martin Schreiber wrote: unsigned:= card32(abs(signed)); This suggests that the result of abs is signed and need an explicit conversion to unsigned. I'm not sure that this is beneficial. OTHO what is abs anyway ? Is it some kind of builtin overloaded function that

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-17 Thread Michael Schnell
On 12/16/2013 04:44 PM, Ivanko B wrote: Then typecasts ABS should be inline-d. Typecast is not only inlined but even builtin (in C source code it not even looks like a function; this is PASCAL specific stuff.) abs() is a special beast, anyway... -Michael

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-17 Thread Michael Schnell
On 12/17/2013 09:30 AM, Michael Schnell wrote: OTHO what is abs anyway ? Is it some kind of builtin overloaded function that works differently for different argument types ? BTW.: Funny stuff: Is the argument of abs() would be fixed to signed, and we would have automatic type conversion

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-18 Thread Michael Schnell
On 12/17/2013 08:24 PM, Sieghard wrote: What's so special about abs? Nothing at all. It's simply a comparison .. abs() looks like a function but in fact it isn't. So it's a very special kind of function (at least it is similar to a set of overloaded function or a kind of generic). In Pascal

Re: [MSEide-MSEgui-talk] MSElang, implicit type conversions

2013-12-18 Thread Michael Schnell
On 12/17/2013 08:24 PM, Sieghard wrote: BUT: Does anybody _really_ think that type casting _does_ something? In fact it does stuff like zero or sign extend or cut away high order bits. -Michael -- Rapidly troubleshoot

  1   2   >