[gambit-list] Declarations inside c-define forms

Alex Queiroz asandroq at gmail.com
Wed Jun 8 08:37:13 EDT 2011


     I have code that I compile with (declare (fixnum)), but some
procedures need generic arithmetic so I add (declare (generic)) in
their scopes. I tried to do this inside a c-define form:

(c-define (c:think level) (int) void "rvs_think" ""
  (declare (generic))
  (let* ((max-time (level->time level))
         (strategy (alpha-beta-searcher-timed 'nega max-time Iago-eval))
         (position (c:current-position))
         (player (position-player position))
         (board (position-board position))
         (move (strategy (game-state-index *c:game-state*) player board)))
    (c:make-move move)))

and got this error:

*** ERROR IN "/Users/alex/Projects/Reverso/iPhone/reverso.scm"@112.3
-- Ill-placed 'declare'

How can I achieve the intended effect?


More information about the Gambit-list mailing list