builtup4/bu4/linking/constructs/lcall.py
2021-08-01 01:17:46 +03:00

27 lines
849 B
Python

# Copyright (c) PARRRATE T&V 2021. All rights reserved.
from bu4.evaluation.av.aftervalue import AfterValue
from bu4.evaluation.av.envtype import envtype
from bu4.evaluation.constructs.elinked import ELinked
from bu4.evaluation.constructs.evaluable import Evaluable
from bu4.evaluation.targets.avcall import AVCall
from bu4.linking.constructs.linked import Linked
__all__ = ('LCall',)
class LCall(Linked):
argument: Linked
lambda_: Linked
def __init__(self, argument: Linked, lambda_: Linked):
self.argument = argument
self.lambda_ = lambda_
self.future = self.argument.future | self.lambda_.future
def evaluable(self, env: envtype) -> Evaluable:
return AfterValue(ELinked(env, self.lambda_), AVCall(env, self.argument))
def __str__(self):
return f'/{self.argument}{self.lambda_}'