oldk1331 wrote: > > > That is a compiler weakness. > > Another compiler weakness is that Record always exports > SetCategory: > > (1) -> Record(a:Type) has SetCategory > > (1) true > > By introducing a new domain 'Pair' can solve this problem. > What's your opinion on that?
It does not solve real problem. Basicaly we want Record to be efficient. And Record must allow any number of fields of arbitrary names. Currently library domains are limited to fixed number of parameters. We could create something taking say List of pairs (fieldname, type of field) as a parameters, but it would be quite hard to make it work efficiently. That is why Record is builtin. Concerning properties of Record, this is essentially question how much we want to build into compiler. In other words, if dissatisfacion with current state of Record is big enough to justify putting extra code into compiler. We have Product domain, but it is limited to two fields names of accessors are fixed and it can not use dot notation. We could modify Product to allow dot notation, but the fixed field names are hard to avoid. IIRC there was proposal (or maybe we had) something named 'Pair' or similar in the past, but it we decided that it is redundant. -- Waldek Hebisch -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To post to this group, send email to fricas-devel@googlegroups.com. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.