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 are

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 Martin Schreiber
On Monday 25 November 2013 10:24:40 Michael Schnell wrote: 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,

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, procedures and functions

2013-11-25 Thread Marcos Douglas
On Mon, Nov 25, 2013 at 7:12 AM, Michael Schnell mschn...@lumino.de wrote: 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

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

2013-11-24 Thread Marcos Douglas
On Sun, Nov 24, 2013 at 3:58 AM, Ivanko B ivankob4m...@gmail.com wrote: Result is also an (undeclared) ghost :) But you can SEE it! Let's cut the E: Exception too, because E variable do not exists... what is happend here blablabla... -- Marcos Douglas

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

2013-11-24 Thread Marcos Douglas
On Sun, Nov 24, 2013 at 4:07 AM, Ivanko B ivankob4m...@gmail.com wrote: A ghost is receiving a value? :-/ = Also interesting to multiple values return w/o intermedialte (local) variables: //(a,b,c,d,e,f,g) :these would be intermediate variables ,:= 1,,,:= var1*3 // b:= ,

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

2013-11-24 Thread Marcos Douglas
On Sun, Nov 24, 2013 at 5:46 AM, Martin Schreiber mse00...@gmail.com wrote: On Saturday 23 November 2013 18:55:00 Marcos Douglas wrote: On Sat, Nov 23, 2013 at 8:20 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 08:32:57 Martin Schreiber wrote: ... sub

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

2013-11-24 Thread Ivanko B
:= result; = Will it cause extra memory copying if function returns a class instance etc ? -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of

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

2013-11-24 Thread Martin Schreiber
On Sunday 24 November 2013 14:48:05 Marcos Douglas wrote: You can not protect the programmers using this. Think. Even if you use 'return', 'result', whatever... if the programmer put a Exit on your code the same error will happen! Bad programmers do it. They forget to create some object, don't

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

2013-11-24 Thread Martin Schreiber
On Sunday 24 November 2013 14:55:03 Ivanko B wrote: := result; = Will it cause extra memory copying if function returns a class instance etc ? A class instance is a pointer - not expensive to copy? It could be optimized to use the assignment destination address directly

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

2013-11-24 Thread Marcos Douglas
On Sun, Nov 24, 2013 at 1:53 PM, Martin Schreiber mse00...@gmail.com wrote: On Sunday 24 November 2013 14:48:05 Marcos Douglas wrote: You can not protect the programmers using this. Think. Even if you use 'return', 'result', whatever... if the programmer put a Exit on your code the same error

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

2013-11-24 Thread Ivanko B
How about EXIT;=GOTO END; to avoid special labeling directly before body's END ? -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R)

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

2013-11-24 Thread Marcos Douglas
On Sun, Nov 24, 2013 at 2:41 PM, Ivanko B ivankob4m...@gmail.com wrote: Also how about BREAK(nesting_level) NEXT(nesting_level) ? Some languages provide that and one is quite handy. +1 -- Marcos Douglas -- Shape the

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

2013-11-24 Thread Martin Schreiber
On Sunday 24 November 2013 17:37:53 Ivanko B wrote: How about EXIT;=GOTO END; to avoid special labeling directly before body's END ? 'exit' *is* 'goto end'. I think there *should* be a label in order to show attention, there is an 'exit' somewhere! Martin

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

2013-11-24 Thread Martin Schreiber
On Sunday 24 November 2013 17:41:11 Ivanko B wrote: Also how about BREAK(nesting_level) NEXT(nesting_level) ? Some languages provide that and one is quite handy. Same as with 'exit'/'return', better to use a 'goto' with a label in order to show by the destination label attention, there is a

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

2013-11-23 Thread Martin Schreiber
On Thursday 21 November 2013 08:32:57 Martin Schreiber wrote: I do not like much the terminating 'return' statement, but sub strfunc(): msestring; var result: msestring; begin result:= 'The string result:' if 1 2 then result:= result + 'mumu'; else result:= result + 'koko';

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

2013-11-23 Thread Martin Schreiber
On Friday 22 November 2013 19:19:10 August Oktobar wrote: What about returning by var? function f(t: T):var T; or function f(t: T):out T; or function f(t: T):T;var; in delphi you must return record by pointer or var/out parameter to avoid copying With the proposed assignment at end of the

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

2013-11-23 Thread Martin Schreiber
On Thursday 21 November 2013 22:51:48 Sieghard wrote: Hallo Martin, Du schriebst am Thu, 21 Nov 2013 07:25:17 +0100: Just a question: could you give some symbolic syntax representation? .. Later when it has been settled down. I don't like to be pinned down or impeached in this early

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

2013-11-23 Thread Marcos Douglas
On Sat, Nov 23, 2013 at 8:20 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 08:32:57 Martin Schreiber wrote: ... sub strfunc2(const avalue: msestring,para: boolean): msestring; begin if para then return 'The not string result'; end; := 'The string

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

2013-11-23 Thread Ivanko B
:= 'The string result: '+avalue; = := instead of exposing Result ? Looks interesting. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech

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

2013-11-23 Thread Ivanko B
:= instead of exposing Result ? =\ And ALSO replaces return. Hmm... Even more interesting :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech

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

2013-11-23 Thread Marcos Douglas
On Sat, Nov 23, 2013 at 6:24 PM, Ivanko B ivankob4m...@gmail.com wrote: := instead of exposing Result ? =\ And ALSO replaces return. Hmm... Even more interesting :) Oh my... WTF is that?! A ghost is receiving a value? :-/ I think is better to turn back to 'Result' variable or

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

2013-11-23 Thread Ivanko B
Result is also an (undeclared) ghost :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight

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

2013-11-23 Thread Martin Schreiber
On Sunday 24 November 2013 07:07:43 Ivanko B wrote: A ghost is receiving a value? :-/ = Also interesting to multiple values return w/o intermedialte (local) variables: //(a,b,c,d,e,f,g) :these would be intermediate variables ,:= 1,,,:= var1*3 // b:= , f:= I think in order

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

2013-11-23 Thread Martin Schreiber
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. Martin

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

2013-11-23 Thread Martin Schreiber
On Saturday 23 November 2013 18:55:00 Marcos Douglas wrote: On Sat, Nov 23, 2013 at 8:20 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 08:32:57 Martin Schreiber wrote: ... sub strfunc2(const avalue: msestring,para: boolean): msestring; begin if para

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, 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, procedures and functions

2013-11-22 Thread August Oktobar
What about multiple return values (e.g. in Golang)? something like this: function Something(a,b:integer):integer, string; begin ... exit(1,'abc'); end; On Fri, Nov 22, 2013 at 7:39 AM, Martin Schreiber mse00...@gmail.comwrote: On Friday 22 November 2013 06:07:37 Ivanko B wrote: Also, we

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

2013-11-22 Thread Marcos Douglas
On Fri, Nov 22, 2013 at 2:25 PM, August Oktobar augustokto...@gmail.com wrote: What about multiple return values (e.g. in Golang)? something like this: function Something(a,b:integer):integer, string; begin ... exit(1,'abc'); end; +1 ! But like this: function

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

2013-11-22 Thread Ivanko B
function Something(a,b:integer):integer, string; Like an [single-row] array of values of diferent type ? Excellent highly demanded ! (it may allow to avoid exessive ugly using var subroutine params )

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

2013-11-22 Thread Ivanko B
Mixing atomic, refcounted object types in same return is appreciated too. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software

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

2013-11-22 Thread Martin Schreiber
On Friday 22 November 2013 18:25:46 August Oktobar wrote: What about multiple return values (e.g. in Golang)? something like this: function Something(a,b:integer):integer, string; begin ... exit(1,'abc'); end; How looks the call of the function? Martin

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

2013-11-22 Thread Ivanko B
How looks the call of the function? == Smth like in Python: (var1,var2):= MultResFunc(arg1,arg2); -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront

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

2013-11-22 Thread Ivanko B
or even : var1^,var2,@var3:= .. -- 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-22 Thread August Oktobar
var s:string; i:integer; s, i := Something(1, 2); or _, s := Something(1, 2); or i, _ := Something(1, 2); or some other keyword (nil?) On Fri, Nov 22, 2013 at 6:49 PM, Martin Schreiber mse00...@gmail.comwrote: On Friday 22 November 2013 18:25:46 August Oktobar wrote: What about multiple

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

2013-11-22 Thread Martin Schreiber
On Friday 22 November 2013 18:52:32 Ivanko B wrote: How looks the call of the function? == Smth like in Python: (var1,var2):= MultResFunc(arg1,arg2); I think the main reason for functions are expressions and subroutine parameters. Use a record (- object in MSElang) in

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

2013-11-22 Thread August Oktobar
What about returning by var? function f(t: T):var T; or function f(t: T):out T; or function f(t: T):T;var; in delphi you must return record by pointer or var/out parameter to avoid copying On Fri, Nov 22, 2013 at 7:09 PM, Martin Schreiber mse00...@gmail.comwrote: On Friday 22 November 2013

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

2013-11-22 Thread Ivanko B
Many funcs should return bool success/failure flag and result value for sucess (and undefined for failure). Mutiple return would excellet for this purpose: ret_code, func_result:= superpuperfunc(..); if ret_code then func_result:= ...; With the VAR approch it looks ugly : if

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

2013-11-22 Thread Martin Schreiber
On Friday 22 November 2013 19:19:10 August Oktobar wrote: What about returning by var? function f(t: T):var T; or function f(t: T):out T; or function f(t: T):T;var; in delphi you must return record by pointer or var/out parameter to avoid copying Are you sure? AFAIK 'result' is a hidden

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

2013-11-22 Thread Sieghard
Hallo Michael, Du schriebst am Fri, 22 Nov 2013 09:28:41 +0100: (With fpc you need to add @ for the second, which I think is extremely ugly.) But it is thoroughly consistent with the use of @ with variables, where it returns their address as well. This makes the C approach (above) look

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

2013-11-22 Thread Sieghard
Hallo Martin, Du schriebst am Fri, 22 Nov 2013 07:49:51 +0100: On Friday 22 November 2013 07:32:17 Martin Schreiber wrote: On Thursday 21 November 2013 22:23:22 Sieghard wrote: THen, what about using the function name as a pseudo variable to pass out the resukt value? (Oops -

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

2013-11-22 Thread Marcos Douglas
On Fri, Nov 22, 2013 at 5:48 PM, Sieghard s_c_...@arcor.de wrote: Hallo Martin, Du schriebst am Fri, 22 Nov 2013 07:49:51 +0100: On Friday 22 November 2013 07:32:17 Martin Schreiber wrote: On Thursday 21 November 2013 22:23:22 Sieghard wrote: THen, what about using the function name as a

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 08:49:10 Ivanko B wrote: It's also possible to define subroutines without keywords at all: - Has the advantage that the name is left-aligned (see attachment). Martin attachment: nosub.pngattachment:

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, procedures and functions

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 10:03:14 Michael Schnell wrote: Slight Advantage of Result: procedure strfunc(x: Boolean): msestring; begin Result := 'The string result'; if x then Result := 'Not The string result'; Result := '' + Result + '' end; Here you don't need

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 3:21 AM, Martin Schreiber mse00...@gmail.com wrote: On Wednesday 20 November 2013 23:01:52 Marcos Douglas wrote: On Wed, Nov 20, 2013 at 1:01 PM, Martin Schreiber mse00...@gmail.com wrote: Hi, '()' for procedure header and procedure calling is mandatory.

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 3:46 AM, Ivanko B ivankob4m...@gmail.com wrote: Oberon uses 'procedure' too. === Then better sub[routine] which means both function procedure :) Worse, sorry. -- Marcos Douglas

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 4:31 AM, Ivanko B ivankob4m...@gmail.com wrote: Sub since it's shorter :) So, use func that is short too, but have better name, IMHO. And how about removing var begin in subroutibe defenitions ? Smth like : --- sub test1(cosnt arg1: integer): bolean

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 4:32 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 07:56:12 Ivanko B wrote: Unneeded extra variables incl stack ones stuff lines, smth like : procedure strfunc(): msestring; begin result:= 'The string result:'

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 6:17 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 10:03:14 Michael Schnell wrote: Slight Advantage of Result: procedure strfunc(x: Boolean): msestring; begin Result := 'The string result'; if x then Result := 'Not The

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

2013-11-21 Thread Ivanko B
For me is ugly to see a procedure call like Foo() = For instance, TCL solves this problem by enclosing subroutine calls in square braces : proc get_res {param1 param2} { return [expr $param1 * $param2] } set res [get_res 3 4] And assigning from other

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

2013-11-21 Thread Ivanko B
Has the advantage that the name is left-aligned (see attachment). But seems unapproppriate for defining netsted subroutines ( looks like calling them ). -- Shape the Mobile Experience: Free

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

2013-11-21 Thread Ivanko B
PERL goes even furher - all variables are prefixed by $ on both sides of assigment, so $ sign distinguishes variables and subroutines so the latter don't need additional marking anymore :) -- Shape the Mobile Experience:

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

2013-11-21 Thread Martin Schreiber
On Friday 22 November 2013 06:07:37 Ivanko B wrote: Also, we don't know what ( var or out ) is current state result. What will locally defined result variable (to assign from in end:=) be ? What's the difference between these result-s ? One can read Delphi 'result' and forget to set it.

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

2013-11-21 Thread Martin Schreiber
On Friday 22 November 2013 07:32:17 Martin Schreiber wrote: On Thursday 21 November 2013 22:23:22 Sieghard wrote: THen, what about using the function name as a pseudo variable to pass out the resukt value? (Oops - that's exactly what original Pascal did...) Actually the exotic proposal

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 9:12 AM, Ivanko B ivankob4m...@gmail.com wrote: PERL goes even furher - all variables are prefixed by $ on both sides of assigment, so $ sign distinguishes variables and subroutines so the latter don't need additional marking anymore :) We need to think why people will

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 11:54 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 13:49:46 Marcos Douglas wrote: On Thu, Nov 21, 2013 at 9:32 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 12:46:55 Marcos Douglas wrote: Please tell me you

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 17:03:16 Marcos Douglas wrote: Please, don't do that... the sintaxe end:= result; is very ugly! Alternatives? Using implicit 'result' variable or 'FUNCTIONNAME' variable is bad because of the unclear input/output state, a mandatory 'return' statement before 'end;'

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 13:49:46 Marcos Douglas wrote: On Thu, Nov 21, 2013 at 9:32 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 12:46:55 Marcos Douglas wrote: Please tell me you have not chosen the keyword sub for procedures/functions. :( Why not?

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 12:54 PM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 16:36:38 Ivanko B wrote: But it may be weird to prepare function code to this final asiigmnent :) Example? Examle of successful realization of a regular (not 2*2) function with such

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 1:27 PM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 17:03:16 Marcos Douglas wrote: Please, don't do that... the sintaxe end:= result; is very ugly! Alternatives? Using implicit 'result' variable or 'FUNCTIONNAME' variable is bad because of

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

2013-11-21 Thread Sieghard
Hallo Marcos, Du schriebst am Thu, 21 Nov 2013 10:23:28 -0200: We need to think why people will use MSElang instead of other language. If we will use specifically things of others languages, is better to use the real language, don't you think? ;-) If this will go on some further, no further

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

2013-11-21 Thread Sieghard
Hallo Martin, Du schriebst am Thu, 21 Nov 2013 07:25:17 +0100: Just a question: could you give some symbolic syntax representation? .. Later when it has been settled down. I don't like to be pinned down or impeached in this early stage. ;-) You'll probabely regret it. Ok, your choice. --

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 18:39:09 Marcos Douglas wrote: On Thu, Nov 21, 2013 at 1:27 PM, Martin Schreiber mse00...@gmail.com wrote: Why needs a 'return' statement only before 'end'? Not only, before end must be a return statement otherwise the return value is undefined. Using 'return'

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

2013-11-21 Thread Sieghard
Hallo Marcos, Du schriebst am Thu, 21 Nov 2013 10:49:46 -0200: Who defined that a function HAVE to return a value ALWAYS? Where is this rule? ;-) Mathematics. -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 16:55:12 Ivanko B wrote: A working example of using RESULT varaiable : -- function monthsstate(aperiodity: msestring): booleanarty; begin  setlength(result,12);  if system.pos('Ja',aperiodity) 0 then result[0]:=true else result[0]:=false; if

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 11:43 AM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 13:48:37 Marcos Douglas wrote: WOW! Exotic too much and worse then use result variable. Why? It shows clearly that it is a write only variable which can not be read and can't be

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

2013-11-21 Thread Sieghard
Hallo Martin, Du schriebst am Thu, 21 Nov 2013 08:32:57 +0100: procedure strfunc(): msestring; ... result:= result + 'koko'; I do not like the not clear definition of 'result', is it a 'var' or 'out' variable? What happens here: It could be considered an automatic local variable of

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

2013-11-21 Thread Ivanko B
This new world seems to be a forgotten old one - sub[routine] :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline

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

2013-11-21 Thread Ivanko B
and work as before? == [..] end:= sqrt(result*10)%i1+pow(3,j) too ? -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R)

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

2013-11-21 Thread Ivanko B
But it may be weird to prepare function code to this final asiigmnent :) Example? Examle of successful realization of a regular (not 2*2) function with such return ? Me can't event imagine how :) -- Shape the Mobile

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 17:41:04 Ivanko B wrote: end:= result; == It means one more memory copying opetation which can be quite expensive in case of large data (dynarrays,..). Dynarrays are reference counted - no problem, there will only a pointer be

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

2013-11-21 Thread Ivanko B
The 'sub' keyword is just ugly, not an error. ;-) = Feels less ugly than function for non-returning procedure for returning :) Show the glue by the ':=' operator assigning a value to the 'end' keyword? It doesn't make any sense for me, sorry. = To put

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

2013-11-21 Thread Ivanko B
No, because it starts statements after 'type' 'const', 'var'. But they (stack consts types subroutines) can be disabled in teh language. -- Shape the Mobile Experience: Free Subscription

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 12:51 PM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 16:32:00 Marcos Douglas wrote: Who defined that a function HAVE to return a value ALWAYS? Where is this rule? ;-) http://en.wikipedia.org/wiki/Function_(mathematics) Pupils

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

2013-11-21 Thread Marcos Douglas
On Thu, Nov 21, 2013 at 3:05 PM, Martin Schreiber mse00...@gmail.com wrote: On Thursday 21 November 2013 18:39:09 Marcos Douglas wrote: On Thu, Nov 21, 2013 at 1:27 PM, Martin Schreiber mse00...@gmail.com wrote: Why needs a 'return' statement only before 'end'? Not only, before end must be

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 15:14:32 Marcos Douglas wrote: On Thu, Nov 21, 2013 at 10:55 AM, Ivanko B ivankob4m...@gmail.com wrote: This new world seems to be a forgotten old one - sub[routine] :) A forgotten old world called MS VisualBasic... =P Older, my first commercial programming tool

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 12:38:19 Marcos Douglas wrote: sub strfunc(): msestring; var result: msestring; begin result:= 'The string result:' if 1 2 then result:= result + 'mumu'; else result:= result + 'koko'; end; end:= result; probably is too exotic. ;-)

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 13:03:01 Ivanko B wrote: PS: BTW, accessing values of variables via a special sign ($ mainly') is excellent feature: set res_var $input_var Why is this an excellent feature? Martin

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 13:48:37 Marcos Douglas wrote: WOW! Exotic too much and worse then use result variable. Why? It shows clearly that it is a write only variable which can not be read and can't be forgotten to set. end is a reserved word, not a variable so it can't receive a

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

2013-11-21 Thread Ivanko B
A working example of using RESULT varaiable : -- function monthsstate(aperiodity: msestring): booleanarty; begin setlength(result,12); if system.pos('Ja',aperiodity) 0 then result[0]:=true else result[0]:=false; if system.pos('F',aperiodity) 0 then result[1]:=true else

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

2013-11-21 Thread Ivanko B
end:= result; == It means one more memory copying opetation which can be quite expensive in case of large data (dynarrays,..). -- Shape the Mobile Experience: Free Subscription Software

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

2013-11-21 Thread Ivanko B
As to () for no params... Why not to make them arbitrary ? Me'd rather use them, though. -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R)

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 16:12:51 Ivanko B wrote: end:= 123; which means assign the sub block with a value. Not that bad when the shock is over. ;-) But it may be weird to prepare function code to this final asiigmnent :) Example?

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

2013-11-21 Thread Ivanko B
And a procedere HAVE to NOT return a value ALWAYS :) -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 13:49:29 Ivanko B wrote: Grouping the parameter signature by '(' ')' is better IMO. === But it makes () for no params mandatory which looks a bit ugly for PASCAL folk :) It is necessary because of orthogonality anyway, clearly denotes the calling of a

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

2013-11-21 Thread Ivanko B
But they (stack consts types subroutines) can be disabled in teh language. What do you want to say with this? As in C/C++ which force all (but cycle vars) type const subroutine declarations to be top-level. --

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

2013-11-21 Thread Ivanko B
Grouping the parameter signature by '(' ')' is better IMO. === But it makes () for no params mandatory which looks a bit ugly for PASCAL folk :) -- Shape the Mobile Experience: Free Subscription Software experts and

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

2013-11-21 Thread Martin Schreiber
On Thursday 21 November 2013 12:28:30 Marcos Douglas wrote: a) New sintaxe for procedure: function func(a: bool8); begin // do not need the return keyword end; b) New sintaxe for function: function func(a: bool8): int32; begin // do need the return keyword return 123; end; That

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

2013-11-21 Thread Ivanko B
the sintaxe end:= result; is very ugly! === No for everyone. It can even be expanded to pipes etc. Remember the BASH syntax : --- cat /tmp/fc-list.txt | egrep -v ^[ \t]*$ | awk \ -v OPT1=$SHORTPATHS \ -v OPT2=$AUTOSHORTGS \ -v OPT3=$PSF_ONLYALIASES \

  1   2   >