Waldek Hebisch <[email protected]> writes:
| Gabriel Dos Reis wrote:
| >
| > Waldek Hebisch <[email protected]> writes:
| >
| > | I would avoid '=='. Currently when '==' defines function with
| > | no arguments and no mode it is conveted to a macro ('==>').
| > | Given that semantics of '==>' is quite different of _expected_
| > | semantics of '==' this is rather weird irregularity.
| >
| > I would think the opposite: if there is there is no modemap or type
| > declaration, then it surely can only be observed locally and it has all
| > the semantics of a local constant, or a macro! I suspect that -may-
| > also have been the reasoning behind Aldor's choice.
| >
|
|
| This is reasonable choice if you _have to_ give meaning to '=='
| in such cases.
Indeed, all flavours of AXIOM support the following style
SomeFunctor(): Public == Private where
Public == some category expression
Privae == some domain expression
I am unconvinced of the value of requiring that to be written as
SomeFunctor(): Public == Private where
Public ==> some category expression
Privae ==> some domain expression
>From my point of view, a macro is a `papering over some pesky imperfection'.
The definition of domain or a category is fundamental and macros should
not be the first thing people have to encounter.
And when I want to attract people used to languages with similar syntax
(hello Haskell!), I don't even want to given them incentives to ridicule
the syntax.
| But signaling error seems better.
|
| For example, look at:
|
| dummy == new()$SE :: F
|
| in combfunc.spad.pamphlet. This is _very_ unlike constants.
In fact, I think this is an example that is illustrative of the constant
vs. nullary function dichotomy.
In this case `dummy' is an abstraction that is supposed to be
generative, e.g. evaluated every time and generate new value. That is
called a function and it should have been written as
dummy(): SE == new()$SE::F
The inlining machinery will take care of making sure a call to dummy()
is in fact inlined (which pretty much is the case for all flavours of
AXIOM for such a simple expression).
| IMHO explicitly writing
|
| dummy ==> new()$SE :: F
|
| would be much clearer.
I would argue that the function definition is much more reflective of
the intent and more elegant. Writing it as a macro only hides the
original intent, it does not make it clearer.
-- Gaby
--
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.