Example #1
0
 def create(s):
     e = E()
     e.t = 'string'
     e.v = s
     f = E()
     f.t = 'const'
     f.v = '?'
     return E.func('`apply', [f, e])
Example #2
0
def _res2E(res):
    if type(res) in [int, float]:
        el = E()
        el.t = 'number'
        el.v = str(res)
        return el
    if type(res) in [str]:
        el = E()
        el.t = 'string'
        el.v = res
        return el
    if type(res) == E:
        if res.isFunc('≺'):
            return res
        return E.func('≺', [res])
    return None