Ver código fonte

Added implementation of has_value in AL

Yentl Van Tendeloo 9 anos atrás
pai
commit
fd832dbf7f
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      bootstrap/primitives.alc

+ 4 - 1
bootstrap/primitives.alc

@@ -116,8 +116,11 @@ Boolean function string_startswith(a: String, b: String):
 	
 	return True
 
+//Boolean function has_value(a: Element) = ?primitives/has_value
+//Boolean function has_value(a: Element):
+	return bool_or(bool_or(bool_or(is_physical_action, is_physical_int(a)), is_physical_float(a)), bool_or(is_physical_string(a), is_physical_boolean(a))))
+
 // TODO: implement these explicitly and split off this code from the primitives completely
-Boolean function has_value(a: Element) = ?primitives/has_value
 Boolean function float_gte(a: Float, b: Float) = ?primitives/float_gte
 Boolean function float_lte(a: Float, b: Float) = ?primitives/float_lte
 Boolean function integer_lte(a: Integer, b: Integer) = ?primitives/integer_lte