[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Hash table mystery
From: |
Jean-Philippe Theberge |
Subject: |
[Chicken-users] Hash table mystery |
Date: |
Thu, 24 Jan 2008 11:03:16 -0500 |
User-agent: |
Mozilla-Thunderbird 2.0.0.9 (X11/20080109) |
Hi,
I hope you can help me as I really dont understand what is the cause of
my problem here.
The code below work perfecly well on my computer (Version 2.732 -
linux-unix-gnu-x86-64)
but give me errors on my server (Version 2.732 - linux-unix-gnu-x86)
The error log say: (first few lines are outputed by "write" in the hope
it will help me understand what's going on)
registration"=>""C-AAA"
serial"=>""1840"
manufacturer"=>""Dehavilland Aircraft Co. Ltd."
model"=>""DH60G"
commercial_name"=>""Dehavilland"
year_build"=>""1931"
ICAO_24bit"=>""110000000000000000000001"
category"=>""Aeroplane"
reg_date"=>""1991-02-05"
reg_effective_date"=>""1978-08-21"
reg_ineffective_date"=>""0000-00-00"
Error: call of non-procedure
500
(reg_ineffective_date reg_effective_date)
Call history:
<eval> [bp!] (current-error-port)
<eval> [bp!] (write "=>" (current-error-port))
<eval> [bp!] (current-error-port)
<eval> [bp!] (write v (current-error-port))
<eval> [bp!] (current-error-port)
<eval> [bp!] (newline (current-error-port))
<eval> [bp!] (current-error-port)
<eval> [bp!] (hash-table-set! BP k v) <--
The code:
(define (ccar->bp c)
;; take a ccar hash and return a bp hash
(define BP (make-hash-table 500))
(define (bp! k v)
;; debug stuff
(write k (current-error-port))
(write "=>" (current-error-port))
(write v (current-error-port))
(newline (current-error-port))
(hash-table-set! BP k v))
(define (ccar k) (hash-table-ref c k))
(bp! 'registration (string-append "C-" (ccar 'TRIMMED_MARK)))
(bp! 'serial (ccar 'MANUFACTURER_SERIAL_COMPRESSED))
(bp! 'manufacturer (ccar 'ID_PLATE_MANUFACTURERS_NAME))
(bp! 'model (ccar 'MODEL_NAME))
(bp! 'commercial_name (ccar 'COMMON_NAME))
(bp! 'year_build (car (string-split (ccar 'DATE_MANUFACTURE_ASSEMBLY)
"-")))
(bp! 'ICAO_24bit (ccar 'MODE_S_TRANSPONDER_BINARY))
(bp! 'category (ccar 'AIRCRAFT_CATEGORY_E))
(bp! 'reg_date (ccar 'ISSUE_DATE))
(bp! 'reg_effective_date (ccar 'EFFECTIVE_DATE))
(bp! 'reg_ineffective_date (ccar 'INEFFECTIVE_DATE))
(bp! 'amateur_build
(if (string=? "M" (ccar 'MANUFACTURE_OR_ASSEMBLY)) 0 1))
(bp! 'number_of_seats (ccar 'NUMBER_OF_SEATS))
(bp! 'MTOW (ccar 'AIR_WEIGHT_KILOS))
(bp! 'number_of_engines (ccar 'NUMBER_OF_ENGINES))
(bp! 'reg_type (ccar 'REGISTERED_PURPOSE_E))
(bp! 'CA_category (ccar 'FLIGHT_AUTHORITY_E))
(bp! 'CA_status (ccar 'ACTIVE_FLAG))
BP
)
Thanks!
--
BuddyPilots <http://www.buddypilots.com>
*Jean-Philippe Théberge*
*Programmeur Architecte*
Tel: (514) 353-2307