|
cazador Apprentice
Joined: 08 Dec 2005 Posts: 108
|
Posted: Wed Apr 01, 2009 12:15 pm
feature requests |
1. zscript to have anonymous functions. This makes it easy to do a call a function like @var[function](params) where function can be a variable. Might be implementable by using lua tables, lua already has this ability.
2. I really like the perl =~s and =~m operators. It would be nice to have similar operators in zmud. Including the ability to specify captures. ex. $var=~s/(This is a test) so is this/$1/
3. It would be nice if the package library would have the notion of required packages needed for a package to run. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Apr 01, 2009 1:53 pm |
Number 3 may not be a good idea. Zugg has said many times that he intended packages to be complete and modular, not depending on any other packages. This really is the best practice. Some have found it necessary to put in package dependencies, but I'm not sure it would be a good idea to encourage the practice.
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Apr 01, 2009 2:59 pm |
I was never a big fan of anonymous functions, so I don't really agree with being built into zScript. Without having actually tested it, I'm sure you could probably do this similar to how you would do indirect variable references, or at the very least with %exec or #EXECUTE.
Number two can easily be handled by the %grep, %match and %regex functions. You can even do pattern matching in a #IF experssion using '=~'. |
|
_________________ Asati di tempari! |
|
|
|
|
|