I'll bite:

how can we code the following trivial example in julia?
>
> class Person
>     attr_accessor :lastname, :firstname
>
>     def fullname
>         "#{firstname} #{lastname}"
>     end
> end
>
> jan = Person.new
> jan.firstname = "Jan"
> jan.lastname = "Janssen"
>
> puts jan.fullname
>

type Person
   lastname::String
   firstname::String
end

fullname(p::Person) = "$(firstname) $(lastname)"

jan = Person("Janssen", "Jan")

println(jan)


Cheers,
   Kevin

P.S. The manual is pretty well written and a good place to learn about
Julia.  Check it out!

Reply via email to