Re: Suggestion for Euphoria 2.3, 2.2a, 2.2.1, whatever

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Thu, 07 Sep 2000, you wrote:
> I noticed several things that C has that Euphoria doesn't. Among these are
> structs and switch statements. It should be easy to implement a struct like:
>
> struct thisStruct do
>   integer a, b
>   sequence st
> end struct

Since a structure is very likely to be constant during its' existence,
why not declare it in much the same way:

structure x =
 integer a,b,
 sequence st
end structure


> And as for the switch statements:
>
> switch a do
>   case 1 do
>     puts(1,"a is 1\n")
>   elsif 2 do
>     puts(1,"a is 2\n")
>   else
>     puts(1,"a is some other value\n")
>   end case
> end switch

Useful,  but ugly.
Why not simplify it somewhat:
case a
 = 1 then  puts(1,"a is 1"),
 = 2 then puts(1,"a is 2"),
 < 5 then puts(1,"a is between 3 and 5")
else
  puts(1,"ERROR")
end case

--
Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu