Design #294
BuiltInFunctions: General "OneLiner" for arguments of different type
Status:
Closed
Priority:
Normal
Assignee:
Category:
Parser/Interpreter
Target version:
Description
one liner functions work like a dream (thanks Giovanni! ;-)
Is it possible to simplify writing the code for overloaded functions?
E.g.
IsZero(RINGELEM/INT/RAT/...)
2014-08 conclusion: using switch
with improved function names and behaviour (documented)
Related issues
History
#1 Updated by Anna Maria Bigatti about 11 years ago
Not quite the dream solution, but I found this function making life easier:evalArgAsT1orT2orT3
int which; intrusive_ptr<RightValue> v = runtimeEnv->evalArgAsT1orT2orT3<BigIntValue, BigRatValue, RingElemValue>(ARG(0), which); ....
#2 Updated by Anna Maria Bigatti about 11 years ago
added also evalArgAsT1orT2orT3orT4 and evalArgAsT1orT2orT3orT4orT5
#3 Updated by Anna Maria Bigatti about 10 years ago
- Subject changed from General "OneLiner" for arguments of different type to BuiltInFunctions: General "OneLiner" for arguments of different type
#4 Updated by Anna Maria Bigatti almost 10 years ago
- Status changed from New to Closed
#5 Updated by Anna Maria Bigatti almost 10 years ago
- Status changed from Closed to In Progress
- Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.1.1 Seoul14
#6 Updated by Anna Maria Bigatti over 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 70
- Estimated time set to 2.00 h
Is the new approach in BuiltInFunctions good enough?
I think so: it is not a one-liner but it's very readable (look for EvalArgAsT1Or..)
Close this issue?
#7 Updated by Anna Maria Bigatti over 9 years ago
- Status changed from Resolved to Closed
- Assignee set to Anna Maria Bigatti
- % Done changed from 70 to 100