Chip's Quips
A tiny spark of wit for a highly flammable world

Truer words were never spoken

September 17th, 2011 9:20:07 am pst by Sterling Camden

True words aren’t spoken
More truth, more contradiction
For truth dislikes words

Tags: , ,

Posted in Get a Grip | No Comments » RSS 2.0

Chipping the web: March 8th

March 8th, 2011 12:01:17 pm pst by Sterling Camden

Chipping the web

Posted in Share the Love | No Comments » RSS 2.0

Regex Anglorum

July 29th, 2010 9:33:18 am pst by Sterling Camden

As I was walking the dogs this morning along our usual route, Halley and Harry stopped to sniff a greasy spot in the road which had been occupied the day before by an unlucky squirrel. “Hmm… some other scavenger must have cleaned it up,” I thought, then corrected myself: “scavenger, or scavengers.”

English has no specific form to indicate “one or more” — nouns can be singular or plural, not (usually) inclusive of both. The more advanced syntax for Regular Expressions uses ‘+’ to indicate this set. I propose that we adopt this into English, as in “some other scavenger+ must have cleaned it up.” That would naturally cause some consternation for present tense verbs when one of these nouns is the subject, but we could use the same ending there: “The scavenger+ eat+ all the dead squirrels.” (I never understood why the ‘s’ occurs on singular verbs instead of on the plural).

Of course, in a regex /scavenger+/ would mean “scavenge” followed by one or more “r”s. We’d need to say /(scavenger)+/ instead.

Wait, that isn’t right either — that just indicates one or more occurrences of the word scavenger. Not one or more scavengers. Abstract symbols are a bit foreign to Regexen, but they do exist in the more advanced syntaxen. Take Ruby’s, for example:

/(#{scavenger})+/

Now that says,”one or more of what the word ‘scavenger’ represents.”

The English language is not nearly so rigorous. Take the plural, for instance. You might think that a regex equivalent for “scavengers” would be:

/(#{scavenger}){2,}/

That says, “two or more of what the word ‘scavenger’ represents.”

In English, though, we also use the plural form for zero. “Yes, we have no bananas.” Let’s add that ambiguity to our expression:

/((#{banana}){2,})*/

The star says, “zero or more of the previous pattern” — so this accurately represents the idea of “two or more bananas, or none at all”.

Of course, in English I could use the singular form for zero as well: “Yes, we have no banana.” That would carry the connotation that we could have exactly one banana, but we don’t. We’re going to need a smarter squirrel.

Posted in Out of Nowhere | 14 Comments » RSS 2.0

Chipping the web: April 2nd

April 2nd, 2010 9:00:11 am pst by Sterling Camden

Chipping the web

Posted in Share the Love | 3 Comments » RSS 2.0

Chipping the web: March 8th

March 8th, 2010 3:01:07 pm pst by Sterling Camden

Chipping the web

Posted in Share the Love | No Comments » RSS 2.0

Chipping the web: November 13th

November 13th, 2009 10:00:00 am pst by Sterling Camden

Chipping the web

Posted in Share the Love | 4 Comments » RSS 2.0

Chipping the web: November 11th

November 11th, 2009 1:00:22 pm pst by Sterling Camden

Chipping the web

Posted in Share the Love | 2 Comments » RSS 2.0

Chipping the web: July 20th

July 20th, 2009 1:00:44 pm pst by Sterling Camden

Chipping the web

Posted in Share the Love | No Comments » RSS 2.0

Chipping the web: July 16th

July 16th, 2009 5:01:52 pm pst by Sterling Camden

Chipping the web

Posted in Share the Love | 1 Comment » RSS 2.0

Chipping the web: June 12th

June 12th, 2009 10:00:56 am pst by Sterling Camden

Chipping the web

Posted in Share the Love | 7 Comments » RSS 2.0