This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Internal Error at compile time - Suggestions?
- From: Ben Simon <benjisimon at gmail dot com>
- To: kawa <kawa at sourceware dot org>
- Date: Wed, 18 Nov 2015 00:15:38 -0500
- Subject: Internal Error at compile time - Suggestions?
- Authentication-results: sourceware.org; auth=none
Howdy all -
I'm starting to flesh out a new Android app written in Kawa and I'm
getting following compile errors:
[java] (compiling
/home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm
to com.benjisimon.thermaroid.main)
[java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:16:36:
internal error - allocate method for LambdaExp:camera-ids/17/l:15 in
module ModuleExp:camera/6/l:5 that has already been compiled
[java] /home/ben/Desktop/i2x/thermaroid/src/com/benjisimon/thermaroid/main.scm:17:39:
internal error - allocate method for LambdaExp:camera-facing/19/l:19
in module ModuleExp:camera/6/l:5 that has already been compiled
The files involved in the compilation are below. Or you can see them
here: https://github.com/benjisimon/thermaroid/tree/master/src/com/benjisimon/thermaroid
I'm using kawa-2.1.1.jar.
What am I missing? Thanks or the assistance.
main.scm is:
---
(define-alias CameraManager android.hardware.camera2.CameraManager)
(define-alias Context android.content.Context)
(define-alias Activity android.app.Activity)
(require 'android-defs)
(require <com.benjisimon.thermaroid.camera>)
(activity main
(on-create-view
(let* ((ids :: string[] (camera-ids))
(directions :: list (map camera-facing ids))
(cam-info (apply string-append
(lambda (id direction)
(string-append id ": " direction))
ids directions)))
(android.widget.TextView (this)
text: (as string cam-info)))))
---
and camera.scm is:
---
(define-alias Activity android.app.Activity)
(define-alias CameraManager android.hardware.camera2.CameraManager)
(define-alias Context android.content.Context)
(define-alias CameraCharacteristics
android.hardware.camera2.CameraCharacteristics)
(module-export camera-ids camera-facing)
(define (camera-mgr) :: CameraManager
(invoke (current-activity) 'getSystemService Context:CAMERA_SERVICE))
(define (camera-ids) :: string[]
(let ((mgr :: CameraManager (camera-mgr)))
(mgr:getCameraIdList)))
(define (camera-facing (id :: string))
(let* ((mgr :: CameraManager (camera-mgr))
(details :: CameraCharacteristics (mgr:get-camera-characteristics id))
(key CameraCharacteristics:LENS_FACING)
(direction (details:get key)))
(vector-ref direction (vector "Front" "Back" "External"))))
---
--
Have an idea for software? I can make it happen -
http://www.ideas2executables.com
My Blog: http://www.BlogByBen.com