On 8/29/19 2:40 AM, Waldek Hebisch wrote:
> Ralf Hemmecke wrote:
>>
>> Suppose in a domain I have a domain that exports
>>
>>   +: (%, %) -> %
>>
>> and I define a function
>>
>>   /: ((%, %) -> %, List %) -> %
>>
>> and then write
>>
>>   _+ / [a, b, c]
>>
>> for a, b, c of type %. Will the compiler use its internal knowledge
>> about the "x" / list special grammar or will it use my definition of / ?
> 
> As written this will work as normal overloaded operator.
> 
> The special syntax requires string form, that is
> 
> "+" / [a, b, c]
> 
> If you use string form, then this will be transformed regardless
> of other functions that you define.

Oh. OK. Then we should get rid of the string from of an operator. I
actually find usage of "+" as an operator quite strange, since it pretty
much looks like a string. I can live for now with _+, but just using the
operator directly, for example, in sort(<, list) would look a bit nicer.

Ralf

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/690bc072-24e7-a43e-cae5-7912b99b7a5a%40hemmecke.org.

Reply via email to