Re: [Vala] About regular expressions and pattern matching



And me, me!
Make the garbage collection, closures, tuples, list comprehensions,
pattern matching and carrying :D:D:D



On Wed, 2008-04-16 at 17:07 +0300, jp0409 jippii fi wrote:
Hi,

Thanks for a great language! I was wondering if you have plans to add 
first class regular expressions? They should be relatively simple to 
implement since the libs are there in Glib but they would make code much 
easier to read compared to calling functions. Replacements based on 
regular expressions could also be there like in Perl (and others).

It would also be nice to have pattern matching that goes beyond simple 
switch statement by allowing matching strings with reg exps (and other 
types like floating point numbers with values or value ranges etc. as 
well) like:

  match (s) {
  on ( /(\d+)?\.\d+/ || /\.\d+/ ) { /* do float stuff */ }
  on ( /\d+/ ) { /* do int stuff, no break needed at the end of block */ }
  default { /* error */ }
  }

Anyway these if..then..elsif... control structures are so common that it 
would make code to look cleaner if there is support for them in the 
language.

Regards,
J-P


__
Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen eturintamassa ja liity Wippiesiin heti!
http://www.wippies.com/

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]