From: Nathaniel Trellice Date: 2007-01-11T21:01:50+09:00 Subject: Sharing constants between C and Ruby code Hello, I'm new to ruby, but fairly experienced in C. I am using Ruby on Rails to chat to a postgres database. I have some C functions that I can run in the database backend. I would like to use constants defined in C header files, e.g "#define MY_CONSTANT 100" within ruby code. I know I can similarly define a constant in ruby, i.e. "MY_CONSTANT=100", but given that I have quite a few of these, and synchronising the two files could become tricky, is there some (preferably simple) clever way/hack that I can define constants in a single file and use them both in C and in Ruby? Thanks, Nat -- Posted via http://www.ruby-forum.com/.