Git Product home page Git Product logo

bitter's People

Contributors

christiansteffens avatar darthpelo avatar uraimo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitter's Issues

Error in "Specific Byte subscript" example

The last line of the first example of the Specific Byte subscript section reads:

// Let's change the third byte
i[3] = 0xAA   //Error! There is no 3rd byte!

However, there's no actual error here because there is a 3rd byte. I was following along in code and at first didn't catch that there's no error, so I thought maybe that Bitter was just silently ignoring the out-of-bounds index since nothing appeared to change. But of course nothing would change by setting byte 3 to 0xAA since it's already 0xAA.

Anyway, I'd suggest something like this instead:

// Let's change the fourth byte
i[4] = 0xFF   //Error! There is no 4th byte!

Migrate the GYB template to Sourcery

Currently, a GYB template is used to generate specific extensions for each integer type.
Even if it's quite easy to figure out how GYB templating works, migrating the template to Sourcery will make the template seem a little less esoteric.
The bash script that generates the classes will have to be updated too.

New features

  • Functions to change endianness of the bitpattern content.
  • Functions to create patterns in addition to allZeroes and allOnes (e.g. 5 ones) to easily generate masks.
  • Migrate the template to Sourcery?

Add a method to generate masks

A small method that generates bit mask for a given number of bits could be useful sometimes.
It could look something like mask(bits:msb:), where bits would be the number of bits that need to be set to 1 and msb a boolean(no need for an enum here) that select if those bits need to be set from the MSB(right) or LSB(left).

Note: Since .allZeroes has been deprecated in Swift 4, when this method is available .allOnes should be removed, it makes no sense to keep it around when mask() can do the same thing and its sibling it's not around anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.