Welcome to my Code Snippets

MyCodeSnippets.Space

dynamic-call

ReAdABLE Source (What is the ReAdABLE Human Format?)

http://mycodesnippets.space/redlang/codegen/dynamic-call.red

Demo

Type in red-lang console:

do read http://mycodesnippets.space/redlang/codegen/src/dynamic-call.red

https://i.imgur.com/phDVUud.png

Code Snippet


show-message: function [/refine msg /popup][

    if not refine [
        msg: "Hello"
        ?? msg
    ]

    either popup [
        view compose [
            text (msg)
        ]
    ][
        print msg
    ]
]

popup: function [msg][
    command: reduce [load "show-message/popup/refine"]
    append command to-word 'msg
    probe command ; [show-message/popup/refine msg]

    ;do [show-message/popup/refine msg] 
    do command ; same as above
]

popup "test"