Giter Club home page Giter Club logo

Comments (4)

sayon avatar sayon commented on August 22, 2024

Thank you for reporting this. It should be fixed in #23. Please tell me if this worked for you -- I've added some more tests as well.

from low-level-programming.

jackc avatar jackc commented on August 22, 2024

I get further this time, but the last test for read_word doesn't match the requirements in the book.

Stops and returns 0 if word is too big for the buffer specified; otherwise returns a buffer address.

The test:

          testing read_word on "asdbaskdbaksvbaskvhbashvbasdasdads wewe"
  read_word : compiled
" asdbaskdbaksvbaskvhbashvbasdasdads wewe " -> ('asdbaskdbaksvbaskvh', 0)
  [   ok   ]

The first 19 characters + terminating null expected by the test harness and sample code - whereas the book requirements are to return 0 when too big.

Also, I found an errata at the end of the chapter (sorry, I bought the book on Kindle so I don't have real page numbers). Footnote 7 lists the codes for what is considered whitespace. 0x10 is not new line. It should be 0xA or decimal 10.

from low-level-programming.

sayon avatar sayon commented on August 22, 2024
  1. It seems that there is a missing point in read_word description: it should return the word length in rdx. I'll add that to errata
  2. Sorry for the bad specs, #26 should do it. I've taken liberty in poking your solution and after uncommenting the lines 189-190 to enable returning string length in rdx the read_word tests are being passed correctly.
  3. Thanks for reporting the error in the footnote, I am fixing it. This is unfortunate, I've not imagined Kindle version will have different page numbers. I am going to put section numbers in the errata as well. Are all footnotes shown at the end of the chapter?

from low-level-programming.

jackc avatar jackc commented on August 22, 2024

👍 Works now. Thanks!

Kindle reformats for the size of device so it doesn't have real page numbers. Section numbers would be great for errata. And yes, footnotes are at the end of the chapter.

from low-level-programming.

Related Issues (20)

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.