Quote:
Originally Posted by Katsunami
Shiiit.... I've looked it up, and that language is actually worse than regular expressions.
|
APL is intended to perform
matrix operations. The guy in question writes financial applications, and was writing code to support bond traders at Morgan Stanley at one point. APL is just
made for stuff like that.
A nice bit about K is that it dispenses with the special
APL character set used to describe the operations it supports. (The old joke in the "Shoot yourself in the foot" classification of programming languages is in APL you shoot yourself in the foot, then spend the next couple of days figuring out how to do it in fewer characters.

)
Quote:
I can believe that guy, however. I've more than once seen people trying to do stuff using if-statements for things such as validation, replacement, and such. With some work, it is often faster and even easier to use regular expressions, and with a lot less code as well.
|
Regular expressions are wild cards on steroids and are extraordinary powerful, but can easily become complex enough the developer ceases to understand them. I've seen at least one app intended to parse and validate REs and help you understand what they are doing and confirm that they are doing what you want.
Quote:
For example, I have an embedded web application, which actually runs on top of PHP. As it has no database, it uses a file called "app.conf.php". The settings are like this:
define("SETTING", "value");
Instead of reading the file line by line into an array of strings, finding the setting, replace the value and then writing back the entire file (which is the way I've seen such things done most often), I just use a command line call to 'sed', and replace the value using a regular expression. (And yes, a take into account that someone could have modified the file, and the setting is now stored as define ("setting" , "VaLuE") )
Thus, I effectively replace (almost) an entire function with one line of code.
|
Which is what you want, as long as you (and anyone else who has to look at it)
understand that one line of code.
Quote:
I can imagine that APL can do the same.
|
Likely.
For another take that is arguably more powerful than regular expressions, see
SNOBOL4 patterns.
______
Dennis