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

BIND and UNBIND can work on blocks not containing (just) words #1958

Closed
rebolbot opened this issue Feb 19, 2013 · 2 comments
Closed

BIND and UNBIND can work on blocks not containing (just) words #1958

rebolbot opened this issue Feb 19, 2013 · 2 comments
Labels

Comments

@rebolbot
Copy link
Collaborator

Submitted by: Ladislav

There is no requirement that the BIND/UNBIND argument shall contain (just) words if it is a block.

I propose to change their help strings to:

{A word or a block (modified) (returned)}
>> source bind

bind: make native! [[
    "Binds words to the specified context."
    word [block! any-word!] "A word or block of words (modified) (returned)"
    context [any-word! any-object!] "A reference to the target context"
    /copy "Deep copy block before binding it"
    /only "Bind only first block (not deep)"
    /new "Add to context any new words found"
    /set "Add to context any new set-words found"
]]

>> source unbind
unbind: make native! [[
    "Unbinds words from context. (Modifies)"
    word [block! any-word!] "A word or block of words (modified) (returned)"
    /deep "Include nested blocks"
]]

CC - Data [ Version: r3 master Type: Bug Platform: All Category: Documentation Reproduce: Always Fixed-in:none ]

@rebolbot
Copy link
Collaborator Author

Submitted by: BrianH

I think that we're going to want to add the paren! type eventually to the typespec for the word argument, so we should make room for it. Removing the extra "a" from the doc string should do it.

Some tweaks:

  • Have the word argument doc string be "A word or block (modified) (returned)" so it's short enough to fit with paren!.
  • Change the BIND/copy string to "Bind and return a deep copy of a block, don't modify original". That should be less ambiguous, and we have enough room for it.

Don't add the paren! type to the word typespec yet, because the code needs a bit of a tweak to not automatically set the block! type on the result. That's a separate fix (and ticket).

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

Pull request submitted with the requested change.

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

No branches or pull requests

1 participant