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/NEW fails inside FUNCTION body #1035

Open
giuliolunati opened this issue Jan 16, 2020 · 1 comment
Open

BIND/NEW fails inside FUNCTION body #1035

giuliolunati opened this issue Jan 16, 2020 · 1 comment
Assignees
Labels

Comments

@giuliolunati
Copy link

f: function [] [ a: 0 bind/new 'b 'a ] f
=>
** Internal Error: locked series expansion
(Obviously enough, func works well.)

@hostilefork hostilefork self-assigned this Feb 9, 2020
@hostilefork
Copy link
Member

(Obviously enough, func works well.)

Unfortunately, it's not necessarily obvious!

Currently BIND is a mutating operation, on the code you run it on. That means if you are to rebind a function body, you will be rebinding it for all calls to that function. I don't like this (at least most of the time, it's not what you want).

This is why I've spoken about "virtual binding" so much. I had suggested maybe IN would be non-mutating (hence allowed on const/locked arrays) while BIND would be mutating (not allowed on const/locked arrays).

Thinking about what are the rules of the Rebol game is hard, I do not know if you read this:

https://forum.rebol.info/t/compatibility-map-each-and-problems-therewith/1192

Binding needs a lot of thought... I'm thinking on it (!)

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