(bind-type Deque <QNode*,QNode*>) (bind-func deque:[Deque{!a}*,!a]* (lambda (value) (let ((node (QNode value null null))) (Deque node node)))) (bind-func head:[QNode{!a}*,Deque{!a}]* (lambda (deque) (tref deque 0))) (bind-func tail:[QNode{!a}*,Deque{!a}*]* (lambda (deque) (tref deque 1))) ($ (let ((d (deque 1))) (println (null? (tref d 1))) ; => 0 (println (null? (tail d))))) ; => Compiler Error null must take a pointer type ast: (null? (head##597 d)) (bind-func emptyp:[i1,Deque*]* (lambda (deque) (if (and (null? (tref deque 0)) (null? (tref deque 1))) #t #f))) ;; fails with: ;; Could not resolve types!::xtlang_expression ;; ------------------------ ;; ($ (let ((d:Deque{i64}* (Deque null null))) (if (emptyp d) "hi" "no")))
I'm sure that I'm misunderstanding something. It seems odd to me that (tref d 1) is not equivalent to (tail d) here, at the very least...
Also, the following closure compiles just fine:
(bind-func empty?:[i1,Deque*]* (lambda (deque) (if (and (null? (tref deque 0)) (null? (tref deque 1))) #t #f)))
but the compiler shouts when I try to compile the following:
($ (let ((d:Deque{i64}* (Deque null null))) (if (empty? d) "hi" "no"))) **** DECL **** **** ENDDECL **** LLVM IR: <string>:59:34: error: expected '(' in function argument list define dllexport fastcc i8 @empty?_poly_W2k4LERlcXVle2k2NH0qXSo__4654(i8* %_impz,i8* %_impenv, %Deque_poly_PGk2ND4* %deque_s_59) nounwind { ^ Compiler Error compiler failed
best,
Danny
--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelang+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Andrew,
Here's QNode:
(bind-type QNode <!a,QNode*,QNode*>)
I believe I'm running from head: I "git pull"d and built from source.
Best,
Danny
-- You received this message because you are subscribed to the Google Groups "Extempore" group. To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
probably from head, though my memory of it isn't sharp.
-- You received this message because you are subscribed to the Google Groups "Extempore" group. To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.