type fruit(sequence unknown_fruit)

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

From A Beginners Guide to Euphoria:

type fruit(sequence unknown_fruit)
sequence valid_fruit
valid_fruit = {"bananas", "apples", "oranges", "pears"}
return find(unknown_fruit, valid_fruit)
end type


This is wierd to me.
It would make more sense like this:

fruit_check = "pears"
fruit fruit_check
puts(1, "Program Run Completed\n")
or
fruit_check = "pears"
fruit_check = fruit(fruit_check)
puts(1, "Program Run Completed\n")


Please, Why is it structured like this?
Thanks!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu