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

Make UNSET of unbound words cause error vs. fail silently #2219

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Closed

Make UNSET of unbound words cause error vs. fail silently #2219

Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Labels

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: fork

Currently if you try to unset a word that is not bound, it is a no-op:

>> type? unset unbind 'x
== unset!

It returns an unset, but nothing happens. If you tried to set such a word, you'd get an error:

>> set unbind 'x none
** Script error: x word is not bound to a context

The same error could be given to indicate that x does not have any associated value to unset. This would be more consistent, because the behavior of unbound things and unset things are different in terms of the error messages you receive when they are run... and also when you use set or get with /any on them:

>> do unbind 'x
** Script error: x word is not bound to a context
>> do [x]
** Script error: x has no value
>> get/any unbind 'x
** Script error: x word is not bound to a context
>> type? get/any 'x
== unset!
; current behavior

>> type? unset unbind 'x
== unset!

; desired behavior

>> unset unbind 'x
** Script error: x word is not bound to a context

Imported from: CureCode [ Version: r3 master Type: Wish Platform: All Category: Native Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#2219

Comments:

Rebolbot commented on May 12, 2015:

Submitted by: abolka

+1


Rebolbot added the Type.wish on Jan 12, 2016


Hostilefork commented on Jan 12, 2016:

This has been implemented as described and considered closed in Ren-C.


Hostilefork added the Ren.resolved on Jun 23, 2018


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

2 participants