Re: New Euphoria features

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

D. Newhall wrote:
> 
> ZNorQ wrote:
> > 
> > IF I'm so lucky, I would wish for the following features;
> > 
> > #1;
> > Select Case
> >   Case .. or ..
> >   Case Else
> > end Select
> > 
> > I hate having to use IF / ELSIF in this case.
> Yeah, lack of select and case statements are really annoying but its one less
> keyword
> that people need to learn about.
> 
> > #2;
> > 100% object oriented? :D
> Hey, Euphoria is a clean and simple language we don't need any objects messing
> it up!
> :p
> 
> (Although, in all honesty I'd rather Rob add gotos then add support for OOP.)
> 
> 
> If I could add anything to Euphoria it'd be pointers. It's annoying when you
> use long
> desriptive variable names to have to type for example (in a program I'm
> working on
> now)
> 
>   if equal( running_tasks[priority][task_id][TASK_NAME], task_to_kill ) then
>     running_tasks[priority][task_id][TASK_NAME] = 
>       kill_task( running_tasks[priority][task_id][TASK_NAME] ) 
>   elsif equal( sleeping_tasks[priority][task_id][TASK_NAME], task_to_kill )
>   then
>     sleeping_tasks[priority][task_id][TASK_NAME] =
>       kill_task( sleeping_tasks[priority][task_id][TASK_NAME] )
>   else
>     printf(2, "Error: No task named %s found.\n", {task_to_kill} )
>   end if
> 
> when using pointers I could just type something along the lines of
> 
>   current_task = pointer_to(running_tasks[priority][task_id][TASK_NAME])
>   if equal(current_task, task_to_kill) then
>     current_task = kill_task(current_task)
>   else
>     current_task = pointer_to(sleeping_tasks[priority][task_id][TASK_NAME])
>     if equal(current_task, task_to_kill) then
>       current_task = kill_task(current_task)
>     else
>       printf(2, "Error: No task named %s found.\n", {task_to_kill})
>     end if
> end if
> 
> The second method is a lot easier to type out and is still just as readable.
> 
If I understand this correctly, we're rather talking about some sort of 
abbrivation - or rather an alias. If I'm not mistaking, there is a
WITH / END WITH for object manipulation in VB (Not sure if it where there 
I saw it) which lets you modify an object without having to give reference 
to the whole 'path', ie. instead of writing the line 
'myObject.myfield.lines.text', you could write 
WITH myObject.myfield.lines DO
  .text = 'This is a test'
  .colour = Blue
  .. etc.
END WITH

Sorry if I totally misunderstood this... :D

Kenneth aka ZNorQ

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

Search



Quick Links

User menu

Not signed in.

Misc Menu