Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-06 Thread Sieghard
Hallo Martin,

Du schriebst am Tue, 6 Jun 2017 13:12:33 +0200:

> Because case in records is crap. It misleadingly pretends that there is
> access type control by the tags and it is clumsy.

No, that's not the case generally. It is so for the Borland dialects, but
not for others. There _are_ Pascal dialects that _do_ make use of the tag
and even change the interpretation of the type accordingly, or that use
separate storage areas for the tagged variants. The problem with this
construct is that it was never clearly specified by the originators (incl.
Prof. Wirth himself) how it was meant to be used and thus how it should be
implemented.
BTW, fpc does indeed store the tag value, if an identifier was specified
along with the tag type for the record declaration. This might be useful at
times to keep track of the data stored in the variant area.

-- 
-- 
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
---
Mit freundlichen Grüßen, S. Schicktanz
---



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-06 Thread Martin Schreiber
On Tuesday 06 June 2017 13:32:28 Michael Schnell wrote:
> On 06.06.2017 13:12, Martin Schreiber wrote:
> > Because case in records is crap. It misleadingly pretends that there is
> > access type control by the tags and it is clumsy.
>
> Right you are. But it never had been different in Pascal :(
>
And it is not a completely new notation, it is the Pascal notation for variant 
parts without the "case".

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-06 Thread Michael Schnell

On 06.06.2017 13:12, Martin Schreiber wrote:


Because case in records is crap. It misleadingly pretends that there is access
type control by the tags and it is clumsy.


Right you are. But it never had been different in Pascal :(

-Michael

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-06 Thread Martin Schreiber
On Tuesday 06 June 2017 11:36:34 Michael Schnell wrote:
> On 04.06.2017 06:21, Martin Schreiber wrote:
> > Yes, and the replacement of "case" in pascal records.
>
> Why introduce a completely new notation instead of just  stay with
> "case" ? This would be rather obvious in Pascal.
>
Because case in records is crap. It misleadingly pretends that there is access 
type control by the tags and it is clumsy.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-06 Thread Michael Schnell

On 04.06.2017 06:21, Martin Schreiber wrote:

Yes, and the replacement of "case" in pascal records.
Why introduce a completely new notation instead of just  stay with 
"case" ? This would be rather obvious in Pascal.


-Michael



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-04 Thread code dz
maybe additional keyword !

tcolor = object
 union
   cl : record // should be another option for anonymous record !?
 r,g,b : byte;
   end;
   rgb : array[0..2] of byte;
 end;
end;

but i like your brackets solution , less verbose , better than case of

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-04 Thread Martin Schreiber
On Sunday 04 June 2017 15:34:14 code dz wrote:
> good , even the brackets is not informative for that purpose .

Alternatives?

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-04 Thread code dz
good , even the brackets is not informative for that purpose .
but , less typing is always good ;)

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-03 Thread Martin Schreiber
On Saturday 03 June 2017 18:46:20 code dz wrote:
> do you mean like union in c++
>
Yes, and the replacement of "case" in pascal records.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Variant part in MSElang objects

2017-06-03 Thread code dz
do you mean like union in c++

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk