1. ADA to EUPHORIA
- Posted by SDPringle Jul 31, 2014
- 1953 views
Forked from Re: A Linux Question
Lots to think about, then. I'm no super-techie when it comes to different OS. I'm a C and ADA programmer of old. I've heard so many horror stories about rooting the Nexus that I'm not sure I want to go down that road. I'd love to hear from someone when they can put together a simple way we can get Euphoria to work on Android devices. Same goes for the iPad and similar.
Thanks for the comments, folks. Really interesting.
Cran0g
I had been thinking and decided that a computer language should have enumerated types as special classes that do not derive from numeric types. I found ADA is such a language. In your experience have you found this feature limiting in some way?
SDPringle
2. Re: ADA to EUPHORIA
- Posted by DerekParnell (admin) Jul 31, 2014
- 1932 views
I had been thinking and decided that a computer language should have enumerated types as special classes that do not derive from numeric types. I found ADA is such a language. In your experience have you found this feature limiting in some way?
No. Also the hint is in the name -- "enumerated" -- They must be numeric in order to be enumerated. If they are not enumerated then they are not numeric.
Can you give an example of what you mean. Is it kind of like a set of related constants, such as ...
set Palette of RED = {"red", 0xFF0000}, YELLOW = {"ylw", 0xFFFF00}, BLUE = {"blu", 0x0000FF}, BLACK = {"blk", 0x000000} end set object x x = {Palette.RED[2]}
3. Re: ADA to EUPHORIA
- Posted by SDPringle Jul 31, 2014
- 1970 views
Hello Derek,
Enumerated values in the language itself are not considered integers. Whereas in say EUPHORIA or C+ + they are. I have never written Ada myself but I point to the example at:
http://en.wikibooks.org/wiki/Ada_Programming/Types/Enumeration
type Primary_Color is (Red, Green, Blue);
Speaking as if we talk about in ADA, if I am not mistaken the expression like 'Red + Blue' will simply not compile. They may be implemented as 1 and 2 but the language above it just says no when you want to add them together. If you could add them or multiply them, you could say that 'Primary_Color' type acts as though it is a subclass (python style) of int. If you defined Primary_Color as a subclass of int, you could certainly define three constants Blue, Red, Green and then you could add them together.
Contrast this with C, C+ +, EUPHORIA.
type enum Primary_Color Red, Green, Blue end type
In most languages these are just integers. So you can do arithmetic on them.
4. Re: ADA to EUPHORIA
- Posted by jaygade Aug 01, 2014
- 1953 views
Enumerations in Swift and Go are pretty interesting, and are not necessarily backed by raw integral values. I'm not even sure if they are always ordered, but I'm still learning.
I don't think those concepts would fit in with Euphoria so well though.
Edit: Sorry, enums in Go are just constants assigned to a value. I'm confusing myself a bit by looking into both languages. Enums in Swift are actually like tagged unions.