From 3028cc4f45d2d7d66456467de506341800df14d8 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 16 Oct 2019 02:19:52 -0400 Subject: Now allowing types for methods. --- stdlib/source/test/lux/extension.lux | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux index 645558d5f..7b2d9ffd5 100644 --- a/stdlib/source/test/lux/extension.lux +++ b/stdlib/source/test/lux/extension.lux @@ -1,5 +1,6 @@ (.module: [lux #* + ["@" target] [abstract [monad (#+ do)]] [control @@ -23,24 +24,29 @@ (def: my-extension "example YOLO") -(analysis: (..my-extension self phase {parameters (<>.some .any)}) - (do @ - [_ (type.infer .Text)] - (wrap (#analysis.Extension self (list))))) +(`` (for {(~~ (static @.old)) + (as-is)} + (as-is (analysis: (..my-extension self phase {parameters (<>.some .any)}) + (do @ + [_ (type.infer .Text)] + (wrap (#analysis.Extension self (list))))) -(synthesis: (..my-extension self phase {parameters (<>.some .any)}) - (wrap (synthesis.text self))) + (synthesis: (..my-extension self phase {parameters (<>.some .any)}) + (wrap (synthesis.text self))) -(directive: (..my-extension self phase {parameters (<>.some .any)}) - (do @ - [#let [_ (log! (format "directive: " (%.text self)))]] - (wrap directive.no-requirements))) + (directive: (..my-extension self phase {parameters (<>.some .any)}) + (do @ + [#let [_ (log! (format "directive: " (%.text self)))]] + (wrap directive.no-requirements))) -("example YOLO") + ("example YOLO") + ))) (def: #export test Test (<| (_.context (%.name (name-of /._))) (_.test "Can define and use analysis & synthesis extensions." - (text@= ("example YOLO") - "example YOLO")))) + (`` (for {(~~ (static @.old)) + false} + (text@= ("example YOLO") + "example YOLO")))))) -- cgit v1.2.3