Skip to content
New issue

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

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

Already on GitHub? # to your account

fix symbol->string to return immutable strings (R6RS §5.10) #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LiberalArtist
Copy link
Contributor

The report says that:

the strings returned by symbol->string … are immutable objects …
An attempt to store a new value into a location referred to by an
immutable object should raise an exception with condition type
&assertion.

The report says that:

> the strings returned by `symbol->string` … are immutable objects …
> An attempt to store a new value into a location referred to by an
> immutable object should raise an exception with condition type
> `&assertion`.
@LiberalArtist
Copy link
Contributor Author

I would have added a test, but I was surprised to see that there already is one:

(test/unspec-or-exn (string-set! (symbol->string 'immutable)
0
#\?)
&assertion)

If I'm understanding correctly, test/unspec-or-exn does not require that an exception be raised. I suppose this is only a "should"-level requirement, which means "that valid reasons may exist in particular circumstances to ignore a statement, but that the implications must be understood and weighed before choosing a different course." Does the test suite intentionally not test such requirements?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant