test cases for KL

42 views
Skip to first unread message

Dmitry Cherkassov

unread,
May 18, 2012, 6:09:32 AM5/18/12
to Qil...@googlegroups.com
Hi! I'm in process of doing native shen port to C language.

The progress so far is that following KL files load:
---------------
toplevel.kl
core.kl
sys.kl
sequent.kl
yacc.kl
reader.kl
prolog.kl
track.kl
load.kl
writer.kl
macros.kl
declarations.kl
----------------

Errors do happen in types.kl namely in declare function:

(declare absvector? (cons A (cons --> (cons boolean ()))))

(it goes to *very long* loop and then segfaults on some trap-error
invocation).

That declare function uses AUM stuff from prolog.kl and it's quite
tricky to find where does error happen.

The problem is clearly with my implementation, so:

Q: does anyone have some simple KL tests used for port testing?
(so that i could test my implementation against them and find errors).

Thank you.

--
With best regards,
Dmitry

Message has been deleted
Message has been deleted

Dominik G

unread,
May 18, 2012, 8:49:08 AM5/18/12
to qil...@googlegroups.com, Qil...@googlegroups.com
Hi,

I created a test suite when creating my Clojure port.

You can find it here:

http://code.google.com/p/shen-to-clojure/source/browse/tests/mytest.shen

(define has to be implemented/correctly evaluated)

Dmitry Cherkassov

unread,
May 18, 2012, 4:42:37 PM5/18/12
to Qil...@googlegroups.com
Dominik G <dgr...@googlemail.com> writes:

> I have created a small test Suite when porting to clojure.
Thanks for that. I managed to fix up some bugs and some edge cases with
that.

Still the problem with *declare* function invocation remains.

Dmitry Cherkassov

unread,
May 18, 2012, 5:17:45 PM5/18/12
to Qil...@googlegroups.com

Anyway. That's the trace log of calling (declare absvector? (cons A
(cons --> (cons boolean ()))))
(all prior KL's are loaded):

it's very huge, but you can see the repeating pattern just by scrolling
it down.

http://pastebin.ca/2150356

any ideas?

Dominik Greibl

unread,
May 19, 2012, 4:52:04 AM5/19/12
to qil...@googlegroups.com

I think I had some similar problem.
If the primitives work correctly, the other problems have to be solved in eval-kl (or eval-without-macros for <4.0).
Or you have to overwrite some function (which should be the last option).

--
You received this message because you are subscribed to the Google Groups "Qilang" group.
To post to this group, send email to qil...@googlegroups.com.
To unsubscribe from this group, send email to qilang+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/qilang?hl=en.

Mark Tarver

unread,
May 19, 2012, 6:05:58 AM5/19/12
to Qilang
Declarations are needed for type checking. What I suggest you do is
build an image w.o. type checking and test the Prolog. If that does
not work, nor will the declarations.

Mark

Dmitry Cherkassov

unread,
May 19, 2012, 8:30:13 AM5/19/12
to Qil...@googlegroups.com
Mark Tarver <dr.mt...@gmail.com> writes:

> Declarations are needed for type checking. What I suggest you do is
> build an image w.o. type checking and test the Prolog. If that does
> not work, nor will the declarations.

So, in other word you advice to avoid loading these KL files:
types.kl"
t-star.kl"

Mark Tarver

unread,
May 19, 2012, 8:33:04 AM5/19/12
to Qilang
correct; test the Prolog.

On May 19, 1:30 pm, Dmitry Cherkassov <dcherkas...@gmail.com> wrote:

Joel Shellman

unread,
May 23, 2012, 11:19:29 AM5/23/12
to qil...@googlegroups.com
> I created a test suite when creating my Clojure port.
> You can find it here:
> http://code.google.com/p/shen-to-clojure/source/browse/tests/mytest.shen
> (define has to be implemented/correctly evaluated)

This appears intended as a kl test. If so, then should it have the
extension .kl? And could it use defun instead of define so it only
requires kl support to run?

Dmitry Cherkassov

unread,
May 24, 2012, 4:58:14 AM5/24/12
to Qil...@googlegroups.com
That test is not KL test, but a port one.
It uses "define", "/." and other things which are not intended to be
implemented by host system.

I've made some changes to make it KL test.

Here is the code:
https://github.com/4DA/shen-native/blob/master/tests.kl
Reply all
Reply to author
Forward
0 new messages