People,
I have a couple of questions on Record.
1. How to construct a record?
"Browse" on Record "Constructors" shows:
"=", coerce, elt, setelt,
and shows the denotation `r.a'
(for selecting a record field, I guess),
but it does not show how to initiate a record.
Then I try
makeR(n: Integer) : Record(no: Integer, b: String) ==
construct(no := n, b := "abc"),
just by guess.
Now, (..) -> makeR 2
produces
(15) [no= 2,b= "abc"] Type: Record(no: Integer,b: String)
-- looks as needed.
2. Is construct(<field-name> := <value>, ...)
an appropriate way to initiate a record?
I was lucky to guess of `construct' and of the `:=' syntax for this.
But I could not find this by "Browse".
Where it is written that there exists the instance of `consruct' for
Record ?
Generally, it is natural for the documentation to list for each type
(domain) _constructor_ which _category instances_ it is provided by
the Axiom library
(may be, doc describes this, I am sorry if I missed it).
3. In iterpreter:
(13) -> construct(no := 1, b := "bc")
(14) [1,"bc"] Type: List(Any)
-- this is different. Further:
(..) -> [1,"bc"] :: Record(no: Integer, b: String)
succeeds.
So: construct(no := n, b := "abc")
or construct(no := n, b := "abc") :: Record(no: Integer, b: String)
-- ?
Thank you in advance for explanation,
------
Sergei
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.