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

Calling an OP one has made oneself gives strange error #1052

Closed
rebolbot opened this issue Jul 6, 2009 · 4 comments
Closed

Calling an OP one has made oneself gives strange error #1052

rebolbot opened this issue Jul 6, 2009 · 4 comments

Comments

@rebolbot
Copy link
Collaborator

rebolbot commented Jul 6, 2009

Submitted by: meijeru

See #1051, and the code hereunder.

>> o: make op! [[][]]
== op!
>> 1 o 2
** Script error: invalid argument: %.bmp

CC - Data [ Version: alpha 66 Type: Bug Platform: All Category: n/a Reproduce: Always Fixed-in:alpha 67 ]

@rebolbot
Copy link
Collaborator Author

rebolbot commented Jul 6, 2009

Submitted by: BrianH

The error is that make op! [[][]] works at all - it should throw an error.

The OP function should be the only way to create a value of that type. If the MAKE action works badly with this specs, then trial and error would eventually lead to specs that work, which would allow recreation of these functions in REBOL code when they are otherwise intentionally inaccessible. This would be a major security hole.

As it is, the behavior of the make action of this types suggests that the resulting function accesses memory badly. This is a worse situation than #1051, where at least the function crashes REBOL. Here, you are apparently able to successfully access a value in memory that doesn't crash the interpreter right away. This means that this is a potential security hole with this spec, let alone some theoretical other spec not yet found.

@rebolbot
Copy link
Collaborator Author

rebolbot commented Jul 6, 2009

Submitted by: Carl

For 3.0.0 - MAKE of op! will now throw an error. However, R3 has been designed to allow user-defined ops... but that feature will be deferred until a future release.

@rebolbot
Copy link
Collaborator Author

rebolbot commented Jul 6, 2009

Submitted by: BrianH

The OP function should be good for making user-defined ops when that feature comes. Is it intended that the function redirected to must be of the action! type, as it is for all current ops?

@hostilefork
Copy link
Member

hostilefork commented Jan 24, 2018

Make OP! does not appear to raise an error in R3-Alpha open source release, and gives the error shown.
Ren-C has changed this completely and has a full means for specifying functions that acquire their argument from the left. There is no OP! (there is only one FUNCTION! type overall), however that function may be associated with a word in SET via an ENFIX binding. This has yielded some very interesting results.

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

No branches or pull requests

2 participants