[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
#1773: Idea: numeric dispatch with switch
From: |
Chicken Trac |
Subject: |
#1773: Idea: numeric dispatch with switch |
Date: |
Fri, 30 Jul 2021 07:34:40 -0000 |
#1773: Idea: numeric dispatch with switch
--------------------------------+----------------------------------------
Reporter: sjamaan | Type: defect
Status: new | Priority: not urgent at all
Milestone: 5.4 | Component: core libraries
Version: 5.2.0 | Keywords: performance, numeric tower
Estimated difficulty: easy |
--------------------------------+----------------------------------------
Just a note to myself so I don't forget:
Get rid of the nested ifs in number dispatch by combining the headers of
objects and then dispatching on the result using `switch`.
The mechanics would be a little bit ugly but possibly it's faster. Even if
it isn't faster, it might be more readable.
Something like:
{{{
switch(COMBINE_TYPES(a, b)) {
case FIXNUM_FIXNUM:
blabla
break;
case FIXNUM_FLONUM:
blabla
break;
....
}
}}}
--
Ticket URL: <https://bugs.call-cc.org/ticket/1773>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- #1773: Idea: numeric dispatch with switch,
Chicken Trac <=