From f410b4d241a6578be409e28c3468893fd3888fdd Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 9 Sep 2014 17:12:37 +0800 Subject: [PATCH] language/core: add array function --- artiq/language/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/artiq/language/core.py b/artiq/language/core.py index ac2946036..d9ebf8cb2 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -1,5 +1,6 @@ from collections import namedtuple from fractions import Fraction +from copy import copy from artiq.language import units @@ -35,6 +36,10 @@ def round64(x): return int64(round(x)) +def array(element, count): + return [copy(element) for i in range(count)] + + def _make_kernel_ro(value): return isinstance( value, (bool, int, int64, float, Fraction, units.Quantity))