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

Permit URL! to be converted to TUPLE! #149

Merged
merged 2 commits into from
Nov 14, 2015
Merged

Permit URL! to be converted to TUPLE! #149

merged 2 commits into from
Nov 14, 2015

Conversation

hostilefork
Copy link
Member

PARSE of a URL! in the network code was capturing a range out of
the content in order to locate the host name. If it were numeric as in
tcp://93.184.216.34 the host name would be converted TO TUPLE!
to signify it was an IP-address.

This was not working, because R3-Alpha would only convert STRING!
and the bug went unnoticed because the conversion was inside of
an ATTEMPT. This changes to accept URL! as the "easy fix", but
adds notes on the matter for deeper consideration.

(Another commit in this PR updates Qualify_String's name and corrals
some hardcoded constants.)

PARSE of a URL! in the network code was capturing a range out of
the content in order to locate the host name.  If it were numeric as in
`tcp://93.184.216.34` the host name would be converted TO TUPLE!
to signify it was an IP-address.

This was not working, because R3-Alpha would only convert STRING!
and the bug went unnoticed because the conversion was inside of
an ATTEMPT.  This changes to accept URL! as the "easy fix", but
adds notes on the matter for deeper consideration.
The routine Qualify_String had a cryptic name, and some instances
would comment what it did...warning readers that it could raise errors
and that the buffer it returned was temporary.  Those two facts were
much more important in the name than "Qualify" or even "String", so
this renames it to `Temp_Byte_Chars_May_Fail` and expands upon
the comments for the reason for its existence.

There were also several hardcoded constants used with this routine
to make buffers such that they would align with the maximum length
of a scanned input for a type.  This puts all those numbers together
as constants in sys-scan.h so that they may be considered (in
particular, how necessary it is to try and codify such limits for these
conversions, as it seems error-prone to keep in sync with the
scanner if new notations arise.)
@hostilefork hostilefork merged commit e03f3cf into metaeducation:master Nov 14, 2015
@hostilefork hostilefork deleted the url-tuple-convert branch November 14, 2015 22:17
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.

1 participant