Folks,
I define a type like this:
(define-type person
id: 83C73CCE-46D5-11D9-9982-00039301BA52
name
birthdate
)
I'm looking to have a case statement where I evaluate the passed object
and take actions depending on its id. I would need to compare object.id
to type.id, though. What statement will give me the object.id and the type.id?
I tried browsing through _nonstd.scm but could not figure out everything
that the define-type macro defines. Is there a way to see all the
constructors, getters, setters, etc. that a macro would define?
Thanks, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums
I might be asking something stupid but does Gambit come with associative
arrays?
How do you implement a registry based on a key then?
Thanks in advance, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums
Howdy!
Is it possible to return continuations to C in Gambit? This is a quote
from the documentation:
"Special care is required for programs which escape to Scheme (using
first-class continuations) from a Scheme to C (to Scheme) call because
the C stack frame will remain on the stack. The C stack may overflow if
this happens in a loop with no intervening return to a C function. To
avoid this problem make sure the C stack gets cleaned up by executing a
normal return from a Scheme to C call."
I would like to call a Sheme service-request function and be able to
return a continuation (think processing web requests). What is the proper
way to do this? Maybe I misunderstood the quote above but the last
sentence concerns me.
Thanks, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums
Folks,
I downloaded the pre-built b9 binaries for Mac OSX. I start up the
interpreter and do the following:
(define-structure point x y)
(define p (make-point 3 5))
The second statement does not work as make-point is not defined. what
gets defined is actually "point" so what works is
(define p (point 3 5))
I took the example straight from the b9 docs, though. What's happening?
Thanks, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums
Folks,
I'm considering writing my poker server in Scheme and C++ by using the
RakNet library (http://www.rakkarsoft.com/) for the network layer and
Scheme for the server logic, etc.
My poker protocol will be a series of binary packets. I guess I have a
few alternatives like serializing a struct into a s-exp initially and to
ease debugging and then move to a binary implementation.
I know PLT Scheme some but I'm totally new to Gambit. My server needs to
support over 1000+ simultaneous users and I need to squeeze the most out
of each server. Folks on the #scheme channel suggested that I use Gambit
so here I am.
My questions are:
-- Should I create structs for my events? For example, game summary
request when a player is in the lobby would not carry any data but the
reply would be a list of game summaries.
-- How do I introduce field types? I would like a balance field to be a
float for example. Do I even need to do this or I should I implement the
portable (endian independent) serialization code in C++ and just query
the structure fields to figure out how to serialize them?
-- Suppose I "serialize" a struct into a vector. When passing the vector
to the external C++ code to be sent over the net are there any endian-
ness issues? How do I avoid them, i.e. store everything big-endian?
-- Is there an elegant recipe to "register" my structs so that when I get
a vector from the network C++ code into scheme I could avoid a long
series of match statements to figure out exactly what kind of a packet I
received?
-- Is there a way to serialize things in some sort of a well-defined
binary format? I would like to have clients that not only use Scheme but
are pure C++ or Java for example. I would like to be able to publish the
protocol and describe the packet structure by saying here goes the float
balance and then an integer id follows, etc.
Thanks in advance, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums