metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
126 stars 27 forks source link

Bug in IMPORT 'MODULE #1124

Closed giuliolunati closed 3 years ago

giuliolunati commented 3 years ago

r3 --do "import 'module" => Error: Cannot FIND evaluative values w/o QUOTE Where: find switch load-module applique import do catch then _ do console ** Near: [* system/modules source 2 else [ return blank ]

(tested with Android nodebug 92171dcf)

hostilefork commented 3 years ago

I don't know what that's supposed to do (load something called %module.reb ?)

If so, perhaps this addresses it:

https://github.com/metaeducation/ren-c/commit/6dfe294be4c5663f9d5de0e2dd87d678f30ba529

giuliolunati commented 3 years ago

It's supposed to search %modules.reb in system/options/module-paths. I use it a lot.

hostilefork commented 3 years ago

Hopefully you see the gist of what ^ does. It is like QUOTE but a bit different...

 >> x: 10

 >> ^ x
 == '10

 >> ^x
 == '10

 >> ^(x + 20)
 == '30

 >> ^[a b c]
 == '[a b c]

Because QUOTED! values now append the value without the quote (takes off exactly one quoting level), you have some nice ways of doing things "as is", and /ONLY is going to be going away...

 >> append [a b c] ^[d e]
 == [a b c [d e]]

But there's an important twist...

>> ^(null)
; null

And there's actually other twists with ^() which are about making it possible to write usermode code like UPARSE which chains invisibles. Feel free to ask any questions on Signal if you find anything confusing...