h3rald / min

A small but practical concatenative programming language and shell
https://min-lang.org
MIT License
311 stars 23 forks source link

Reflection-I #87

Closed ghost closed 3 years ago

ghost commented 3 years ago

We should access parameters, returnings as quotes from in operator body:

(:n ( (n integer?) (n 0 >) ) &&) 'posint typeclass

( symbol sym-reflection
    (
        (int | string :t) :begin
        t :end
        posint :step
            ==>
        quot :yey
        string :haha
    )
    (
        params puts!
        ;
        ; For example writes on screen:
        ; (
        ;   ('int 'begin)
        ;   ('int 'end)
        ;   ('type:posint 'step)
        ; )
        ;

        returns puts!
        ;
        ; For example writes on screen:
        ; (
        ;   ('quot 'yey)
        ;   ('string 'haha)
        ; )
        ;
    )
) ::
ghost commented 3 years ago

What do you think about?

ghost commented 3 years ago

Ah, i forgot. It is a idea. And i opened a issue 🤦 🥇