Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow writing hex file (and streams and strings). #3

Merged
merged 2 commits into from Jan 17, 2016
Merged

Allow writing hex file (and streams and strings). #3

merged 2 commits into from Jan 17, 2016

Conversation

zellerin
Copy link
Contributor

Names of the (exported) write functions made analogous to the read ones.

Different behaviours from read:

  • both vector and list of alternating addresses and vectors allowed.
  • only type 0 and 1 lines are generated
  • allows storing from 16 or 32 (or whatever octet multiple) bit vectors as
    well.

Separated package.lisp.

Documentation is updated. Some tests added. Not all cases covered by
tests, though.

Names of the (exported) write functions made analogous to the read ones.

Different behaviours from read:
- both vector and list of alternating addresses and vectors allowed.
- only type 0 and 1 lines are generated
- allows storing from 16 or 32 (or whatever octet multiple) bit vectors as
well.

Separated package.lisp.

Documentation is updated. Some tests added. Not all cases covered by
tests, though.
@zellerin
Copy link
Contributor Author

For discussion.
Currently, this is completely separate code, the only interaction being one test.

@takagi
Copy link
Owner

takagi commented Jan 16, 2016

Thanks. What is your concern for discussion? How I think is that it is okay if read/write APIs are consistent so that library users easily guess how to use them and how they works, the style of implementation does not matter. I think your changes are basically acceptable for me.

I have two things about the writing API:

  • How about making offset of offset-and-data a keyword parameter &key offset?
  • How about making the default value of write-hex-to-file's if-exists keyword parameter adopting that of open function for consistency with CL spec?

@zellerin
Copy link
Contributor Author

Thanks,
I wanted to know if you have any concerns with the change. Apart from API, I do not know how to fully cover file creating code in your coverage tool, and if it concerns you.

offset-and-data: I want to be able to be able to pass (0 code #x2007 config #x2100 rom) to it. I am afraid single offset key parameters will not cover that.

:if-exists: Ok, it makes sense to make it consistent to open call. I am fine with changing default to :error, but I do not see easy way and benefit of doing full default (:new-version if the version component of filespec is :newest, or :error otherwise). Shall I change to :error and add new pull request, or will you do?

@takagi
Copy link
Owner

takagi commented Jan 16, 2016

Okay. I understand what you intend.

Would you change the default? I suppose that your commit follows this pull request, new pull request is not needed. Then I will merge it.

@zellerin
Copy link
Contributor Author

Changed.

takagi added a commit that referenced this pull request Jan 17, 2016
Allow writing hex file (and streams and strings).
@takagi takagi merged commit 1575b6e into takagi:master Jan 17, 2016
@takagi takagi mentioned this pull request Jan 17, 2016
@zellerin zellerin deleted the with-write branch February 15, 2016 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants