;; -*-theme-d-*-

;; Copyright (C) 2008-2013 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

;; Expected results: translation and running OK
;;  but running requires my-apply to be defined in
;;  the runtime environment.

(define-proper-program (tests test145)

  (import (standard-library core)
	  (standard-library console-io))

  (define my-apply
    (unchecked-param-prim-proc my-apply
			       (%arglist %result)
			       ((:procedure ((splice %arglist)) %result pure)
				%arglist)
			       %result
			       pure))

  (define-simple-proc proc (((o1 <integer>) (o2 <symbol>) (o3 <string>))
			    (:tuple <string> <symbol> <integer>)
			    pure)
    (list o3 o2 o1))

  (define main
    (lambda (() <none> nonpure)
      (let* ((lst '(1 abc "def"))
	     (result (my-apply proc lst)))
	(console-display result)
	(console-newline)))))

