Re: [Vala] Contracts on lambdas
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: Tristin Celestin <tristin_celestin yahoo com>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Contracts on lambdas
- Date: Sun, 28 Mar 2010 22:26:16 +0100
Hi,
2010/3/26 Tristin Celestin <tristin_celestin yahoo com>:
Is it possible to write a lamba expression with a contract? This is
what I try to do now, and I get a compiler error.
Example:
delegate void strict_increment (int value);
...
int local_value = 0;
strict_increment = (value) requires (value > 0) => {
local_value += value;
}
I'm not sure this can be implemented, but you can always do it the
manual way, with return_if_fail/return_val_if_fail for requires and
warn_if_fail for ensures.
HTH,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]