forum-msg-id-135916-edit

Original date:2021-02-25 13:55:42 Edited by: mitgedanken Subject: Re: Responding to mitgedanken Re: fake class in OE

[quote katsmeow] Responding to mitgedanken ...

The problem with export function get_horns() is the same problem with most computer languages, and some people: it's fixed, the system is fixed, you cannot add a get_ anything else while the program is running, or any sort of parameter which you may discover next week. With this way of doing things, the programmer must know in advance all the possible things that could be setted or getted, and write code for it, which if you think about all the things in the world you know parameters about, is going to make for a terribly bloated application.

[...]

Kat [/quote]

You're right!
I tried to use only current Euphoria keywords as possible.

Something like ... ?

writable integer horns  -- if it's writable it's readable too 
readonly sequence name 

Or mutable immutable. Both examples only as a suggestion.

Edit

public integer horns 
export sequence name 

But I'm not sure if this is a good idea.
end Edit

  my_cow#name = "Polly" -- error/crash 
  my_cow = Cow#name -- ok 
  my_cow = Cow#get_var('name') -- ok 
  -- set_var(..., ...) -- error/crash 
   
  my_cow#horns = 1 -- ok 
  my_cow#set_var('horns', 1) -- ok 
  if my_cow#horns > 0 then -- ok 
   ... 
  end if 

Sara |mitgedanken|

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu