diff --git a/hy/compiler.py b/hy/compiler.py index 8a80673..5a76bea 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -697,21 +697,12 @@ class HyASTCompiler(object): expr.pop(0) n = self.compile(expr.pop(0)) seq = self.compile(expr.pop(0)) - zero = ast.Num(n=0, - lineno=expr.start_line, - col_offset=expr.start_column) - upper = ast.UnaryOp(op=ast.USub(), - operand=n, - lineno=expr.start_line, - col_offset=expr.start_column) - if upper.operand.n == 0: - return seq return ast.Subscript( lineno=expr.start_line, col_offset=expr.start_column, value=seq, - slice=ast.Slice(lower=zero, - upper=upper, + slice=ast.Slice(lower=n, + upper=None, step=None), ctx=ast.Load()) diff --git a/tests/native_tests/language.hy b/tests/native_tests/language.hy index 47eaf5a..3c36fb8 100644 --- a/tests/native_tests/language.hy +++ b/tests/native_tests/language.hy @@ -386,7 +386,7 @@ (defn test-drop [] "NATIVE: test drop" (assert (= (drop 0 [2 3]) [2 3])) - (assert (= (drop 1 [2 3]) [2])) + (assert (= (drop 1 [2 3]) [3])) (assert (= (drop 2 [2 3]) [])))