Avoid C-isms #5

Merged
PuercoPop merged 4 commits from avoid-c-isms into master 2019-04-02 07:25:07 +00:00
PuercoPop commented 2019-03-28 04:12:37 +00:00 (Migrated from github.com)

Using ldb/dpb instead of shifting bits and adding 'numbers' is not only more direct but also generates more efficient code in SBCL. This is not the case in all implementations. For example ECL will still compile to code that does more or less the name (ash + ecl_boole). I also refactored common code so that we only need to specify the number of octets to decode or decode and the decoder is derived for us as well as leaving some constants 'unfolded' so that their meaning is more apparent but moving the computation to read-time so the resulting code stays the same.

Using `ldb/dpb` instead of shifting bits and adding 'numbers' is not only more direct but also generates more efficient code in SBCL. This is not the case in all implementations. For example ECL will still compile to code that does more or less the name (ash + ecl_boole). I also refactored common code so that we only need to specify the number of octets to decode or decode and the decoder is derived for us as well as leaving some constants 'unfolded' so that their meaning is more apparent but moving the computation to read-time so the resulting code stays the same.
zzkt commented 2019-04-02 07:25:45 +00:00 (Migrated from github.com)

Thanks @PuercoPop

Thanks @PuercoPop
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: zzkt/osc#5
No description provided.