30 lines
857 B
Python
30 lines
857 B
Python
# Copyright (c) PARRRATE T&V 2021. All rights reserved.
|
|
|
|
from typing import TypeVar, Generic
|
|
|
|
from bu4.evaluation.constructs.attachable import Attachable
|
|
from bu4.evaluation.constructs.eattachable import EAttachable
|
|
from bu4.evaluation.constructs.evaluable import Evaluable
|
|
from bu4.evaluation.constructs.evalue import EValue
|
|
from bu4.evaluation.targets.avanonymouscontainer import AVAnonymousContainer
|
|
|
|
__all__ = ('EDelayed',)
|
|
|
|
T = TypeVar('T')
|
|
|
|
|
|
class EDelayed(EValue, Generic[T]):
|
|
def __init__(self, env: T, value: Attachable[T]):
|
|
self.env = env
|
|
self.value = value
|
|
self.evaluable = AVAnonymousContainer(EAttachable(
|
|
self.env,
|
|
self.value
|
|
)).after_value
|
|
|
|
def call(self, argument: Evaluable) -> Evaluable:
|
|
return self.evaluable
|
|
|
|
def __str__(self):
|
|
return f'&{self.value}'
|