REBOL3 tracker
  0.9.12 beta
Ticket #0002167 User: anonymous

Project:

Previous Next
rss
TypeWish Statussubmitted Date26-Aug-2014 16:15
Versionr3 master CategoryUnspecified Submitted byfork
PlatformAll Severityminor Prioritynormal

Summary Unify FUNCTION! and CLOSURE! types by putting CLOSURE: in the function spec
Description Currently there are two distinct types for functions and closures. This is despite the fact that from a usage-level, there is not really much of a reason why something that would take a FUNCTION! wouldn't allow you to pass in a CLOSURE! or vice-versa.

The prescription is to use the typeset ANY-FUNCTION! to catch both types. But it raises the point that at an implementation level, the flag for whether something is a closure or not could be managed by a signal in the function's spec rather than by its type. It's easy to forget to match both, and will be especially frustrating if using a library someone wrote where they missed this case.

CureCode ate my ticket because of login reasons but long story short was:

>> x: closure [a b] [c: a + b return [c]]

>> probe :x
make function! [[
closure:
a b
local: c
] [
c: a + b return [c]
]

Nothing that this includes CC#2108 for /LOCAL => local:

This also reclaims a type, which are oft-cited as being a scarce resource.
Example code

			

Assigned ton/a Fixed in- Last Update28-Aug-2014 23:07


Comments
(0004498)
Ladislav
28-Aug-2014 16:23

This is most certainly not a bug.
(0004502)
fork
28-Aug-2014 23:07

I was trying to close all the browser tabs for a reboot and found an unfinished proposal in a tab. Knowing it might fail AND then not let me use browser back to get the content, I copied it to the clipboard first. Or so I thought. When I pushed the button--it failed and did not let me go back, and somehow my paste of the content only pasted the first two paragraphs.

Angry and shaking my fists at the sky--wondering why hath God forsaken me--I typed the minimum necessary to complete the entry instead of recomposing. In doing so, I neglected to categorize it from the short list of categories.

Mystery solved.

Date User Field Action Change
28-Aug-2014 23:07 Fork Type Modified Bug => Wish
28-Aug-2014 23:07 Fork Comment : 0004502 Added -
28-Aug-2014 16:23 Ladislav Comment : 0004498 Added -
26-Aug-2014 16:19 Fork Description Modified -
26-Aug-2014 16:15 Fork Ticket Added -