Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor fix

  • Loading branch information...
commit 6f5204f5a38b55dd8f7f37c72088e652e417ac6c 1 parent 83a32b6
nineties authored
8 rowl1/rowl1-compile.rlc
View
@@ -2,7 +2,7 @@
; rowl - 1st generation
; Copyright (C) 2010 nineties
;
-; $Id: rowl1-compile.rlc 2013-03-17 16:46:41 nineties $
+; $Id: rowl1-compile.rlc 2013-03-19 17:22:33 nineties $
;
(import "rlvm-compile")
@@ -23,6 +23,12 @@
(var noguard (to_sym "%noguard"))
(var closed (to_sym "%closed"))
+(export fun unwrap_internal (node) (
+ (if (== (node_head node) Ref)
+ (return (unwrap_internal (node_arg node 2))))
+ (return node)
+ ))
+
; compilers
(extern object current_loc)
8 rowl1/rowl1-pprint.rlc
View
@@ -2,7 +2,7 @@
; rowl - 1st generation
; Copyright (C) 2012 nineties
;
-; $Id: rowl1-array.rlc 2013-03-05 07:02:27 nineties $
+; $Id: rowl1-array.rlc 2013-03-19 17:26:12 nineties $
;
(import "rlvm-compile")
@@ -47,9 +47,10 @@
))
(fun pprint_main (ochan obj) (
+ (= obj (unwrap_internal obj))
(tswitch (node_type obj) (
(@SymbolE . (return (output_symbol ochan obj)))
- (@ExprE . (return (pp_expr ochan obj)))
+ (@ExprE . (return (pp_node ochan obj)))
(@ListE . (return (pp_list ochan obj)))
(@ArrayE . (return (pp_array ochan obj)))
(@TableE . (return (pp_table ochan obj)))
@@ -130,7 +131,8 @@
(return @C_NIL)
))
-(fun pp_expr (ochan node) (
+(extern fun unwrap_internal)
+(fun pp_node (ochan node) (
(output_symbol ochan (node_head node))
(output_char ochan '{')
(var n (node_size node))
13 rowl1/rowl1-tuple.rlc
View
@@ -2,7 +2,7 @@
; rowl - 1st generation
; Copyright (C) 2010 nineties
;
-; $Id: rowl1-list.rlc 2013-02-06 23:09:39 nineties $
+; $Id: rowl1-list.rlc 2013-03-19 11:49:08 nineties $
;
(import "rlvm-compile")
@@ -54,6 +54,15 @@
(return t)
))
+(fun tp_new (n) (
+ (= n (unbox n))
+ (var t (allocate_tuple n))
+ (for i 0 n (do
+ (array_set object t i @C_UNDEF)
+ ))
+ (return t)
+ ))
+
(fun tp_length (t) (
(return (box (seq_size t)))
))
@@ -139,6 +148,8 @@
))
(export fun setup_tuple (std) (
+ (var mod (create_module std (to_sym "Tuple")))
+ (add_function1 mod (to_sym "new") intT tp_new 0)
(add_function1 std (to_sym "length") tupleT tp_length 0)
(add_function1 std (to_sym "size") tupleT tp_length 0)
(add_function1 std (to_sym "hash") tupleT tp_hash 0)
Please sign in to comment.
Something went wrong with that request. Please try again.