chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #574: Define-constant cannot be used with the FFI


From: Chicken Trac
Subject: [Chicken-janitors] #574: Define-constant cannot be used with the FFI
Date: Tue, 10 May 2011 17:44:40 -0000

#574: Define-constant cannot be used with the FFI
--------------------------------------------+-------------------------------
 Reporter:  sjamaan                         |       Owner:  felix
     Type:  defect                          |      Status:  new  
 Priority:  not urgent at all               |   Milestone:       
Component:  compiler                        |     Version:  4.6.x
 Keywords:  constants, ffi, foreign values  |  
--------------------------------------------+-------------------------------
 I'm not 100% sure this is even a bug or just bad documentation/error
 messaging, but here goes:

 If I compile the following "program", I get an error message:

 {{{
 #!scm
 (define-constant one (foreign-value "1" int))
 }}}

 The error says

 {{{
 Syntax error: cannot evaluate compiler-special-form

         (##core#define-foreign-variable code_0 int "1")
 }}}

 I can see why; in compiler.scm, line 1111 under {{{##core#define-
 constant}}} it runs {{{eval}}} on the constant that's defined (unless it's
 a collapsible literal) but of course {{{eval}}} doesn't have access to
 compiler syntax, so it dies.

 The question is - should this be an error or not?  It might make sense to
 just put the foreign value as-is in each usage point.

 PS: there's a small spelling error in there, the predicate {{{collapsable-
 literal?}}} should be {{{collapsible-literal?}}} with an "i" instead of an
 "a".

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/574>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]