[HCoop-Discuss] [docelic, ntk] Cracking down on negative balances
Adam Chlipala
adamc at hcoop.net
Wed Feb 20 21:29:56 EST 2008
Nathan Kennedy wrote:
> My ML is extremely rusty, and I was an OCaML guy anyway, but rather than
> have Adam do _everything_ with the portal I thought I'd give it a poke.
>
> Isn't all you have to do is change this in init.sml:
> fun modUser (user : user) =
> ...
> shares = ^(C.intToSql (#shares user))
> to this:
> shares = ^(C.intToSql(if (#bal user) <= 0 then 1 else (#shares user)))
>
> or something like that? My syntax may be off. Not much of an
> "addition" but seems to do the trick nicely.
>
I didn't mean to suggest that it was hard to implement. I think your
suggestion has some undesirable properties, like having these updates
happen without notice to anyone. I'll implement it some other way this
weekend.
More information about the HCoop-Discuss
mailing list