From f227736eec38ea43ca3ef3c726bec3830f08c478 Mon Sep 17 00:00:00 2001 From: Francis Smart Date: Tue, 22 Apr 2014 14:22:35 +0200 Subject: [PATCH] Added notes function example Added notes function example under Composite Types showing how to return a list of field names --- doc/manual/types.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/manual/types.rst b/doc/manual/types.rst index 785dcb14c2850..78ecdca515e9e 100644 --- a/doc/manual/types.rst +++ b/doc/manual/types.rst @@ -353,6 +353,15 @@ this implied type signature: julia> Foo((), 23.5, 1) ERROR: no method Foo((), Float64, Int64) +You may find a list of field names using the ``names`` function. + +.. doctest:: + julia> names(foo) + 3-element Array{Any,1}: + :bar + :baz + :qux + You can access the field values of a composite object using the traditional ``foo.bar`` notation: