From b07a8ad579039cc878e233670768aade07e2e678 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 25 Jul 2017 21:21:39 -0400 Subject: - Models now only rely on normal (inline) casting functions. Hopefully, in the future, they will be completely optimized away. --- stdlib/source/lux/type/model.lux | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/lux/type/model.lux b/stdlib/source/lux/type/model.lux index 475458520..0914cfdf1 100644 --- a/stdlib/source/lux/type/model.lux +++ b/stdlib/source/lux/type/model.lux @@ -73,14 +73,10 @@ (function [tokens] (case tokens (^ (list value)) - (wrap (list (if (list;empty? type-vars) - (` (|> (~ value) - (: (~ (code;local-symbol (representation-name name)))) - (:! (~ (code;local-symbol name))))) - (` ((: (All [(~@ type-varsC)] - (-> (~ representation-declaration) (~ model-declaration))) - (|>. :!!)) - (~ value)))))) + (wrap (list (` ((: (All [(~@ type-varsC)] + (-> (~ representation-declaration) (~ model-declaration))) + (|>. :!!)) + (~ value))))) _ (macro;fail (format "Wrong syntax for " down-cast))))]))) @@ -89,14 +85,10 @@ (function [tokens] (case tokens (^ (list value)) - (wrap (list (if (list;empty? type-vars) - (` (|> (~ value) - (: (~ (code;local-symbol name))) - (:! (~ (code;local-symbol (representation-name name)))))) - (` ((: (All [(~@ type-varsC)] - (-> (~ model-declaration) (~ representation-declaration))) - (|>. :!!)) - (~ value)))))) + (wrap (list (` ((: (All [(~@ type-varsC)] + (-> (~ model-declaration) (~ representation-declaration))) + (|>. :!!)) + (~ value))))) _ (macro;fail (format "Wrong syntax for " up-cast))))]))))]] -- cgit v1.2.3