metaeducation / rebol-issues

6 stars 1 forks source link

Need official func spec grammar rules #169

Open rebolbot opened 17 years ago

rebolbot commented 17 years ago

Submitted by: Gregg

Should there be an official spec available for the func spec dialect? Reason one being that writing reflective tools would benefit. Reason two being that without an official standard, it's hard to know how best to extend it, what's planned for in the design, etc.

For example, I thought my parser was pretty good, but didn't account for this:

bc.. >> third :unset? == ["Returns TRUE if it is this type." value [any-type!] 1]

p.

Where the doc-string for an arg is not a string. Is that a special case for type-check actions; you can only use an integer or a string, and the integer case is the exception for internal use?

The latter case would be for things like Ladislav's HOF, Maarten's DbC, AOP, etc.

Another case is EXTRACT, where the doc-string for the refinement param comes before the param type:

bc.. /index "Extract from an offset position" pos "The position" [number! logic!]

p.

CC - Data [ Version: alpha 31 Type: Wish Platform: All Category: Documentation Reproduce: Always Fixed-in:none ]

rebolbot commented 17 years ago

Submitted by: admin

See, and add notes to, %users/gregg/func-spec.txt

rebolbot commented 15 years ago

Submitted by: BrianH

This should be in DocBase in the functions section.

hostilefork commented 3 years ago

Should there be an official spec available for the func spec dialect? Reason one being that writing reflective tools would benefit. Reason two being that without an official standard, it’s hard to know how best to extend it, what’s planned for in the design, etc.

I agree that it would be good to formalize the dialect. However, Ren-C has made significant advances in moving away from the need to know the spec dialect to process parameters or get documentation strings.

This is because the spec dialect is an artifact of the FUNC native. Creating functions can be done by making FRAME!s and then ADAPTing them directly. Parameter help strings can also be poked into frames directly. This means analyzing function specs is really not done by anything but FUNC.


Note: Red has an "enhancement proposal" on the topic of establishing a spec, but it is basically empty at time of writing.

https://github.com/red/REP/blob/master/REPs/rep-0102.adoc

I copied the link to put here before realizing it was empty. But, maybe it won't always be. 🤷‍♂️