Enable support for types' properties

This commit is contained in:
Bartłomiej Pluta
2019-07-08 22:06:38 +02:00
parent 74eec7f997
commit b06a8533c0
22 changed files with 77 additions and 126 deletions

View File

@@ -1,13 +1,11 @@
from smnp.library.model import CombinedFunction, Function
from smnp.library.signature import signature, listOf, ofTypes, varargSignature
from smnp.type.model import Type
from smnp.type.value import Value
_signature1 = varargSignature(ofTypes(Type.NOTE), ofTypes(Type.INTEGER), ofTypes(Type.INTEGER))
def _function1(env, n, m, vararg):
t = [Value(Type.NOTE, arg.value.withDuration(arg.value.duration * n.value / m.value)) for arg in vararg]
return Value(Type.LIST, t).decompose()
t = [Type.note(arg.value.withDuration(arg.value.duration * n.value / m.value)) for arg in vararg]
return Type.list(t).decompose()