Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thesaurus for programming keywords

Tags:

meta

Imagine having a TheSaurus for programming language Keywords and Concepts that responds to queryes with synonyms and antonyms that are strictly other language keywords or operands. Asking for ">=" the user will be presented with "<=" as antonym and ">" as a synonym (it's an example). Which Antonym will you expect to find searching for the term "for each"?

If this is OT let me know. I'm not so at pace with the community since years.

like image 806
vaitrafra Avatar asked Aug 29 '12 13:08

vaitrafra


People also ask

What is a keyword thesaurus?

A keyword's synonym is a word or phrase that means something similar to your keyword. For example, if you're writing a post about “dog food,” keyword synonyms might be “food for dogs,” “food for old dogs,” “pet food,” or “puppy food.”

What is thesaurus in computing?

A thesaurus is a software tool included with some word processors that provides synonyms for selected words on command. Users using Microsoft Word can open a thesaurus by highlighting the word they want to look up and pressing the shortcut key Shift + F7 .


2 Answers

The antonym for foreach would be fornone, but since that wouldn't be very useful you wouldn't find it in any programming language, unless you count things like Python's pass or a NOOP.

However the while-loop can be a synonym for foreach in some contexts and the while loop does have a direct antonym with the until-loop (available in Ruby, Bash and Lisp). Similarly there exist an antonym for the if statement with the unless statement.

I am not aware of any reasonably complete Programmer Thesaurus that could answer such and similar questions, however there are a few projects on Github that might act as a starting point:

  • https://github.com/tindzk/thesaurus
  • https://github.com/wobh/lexicode
  • https://github.com/imightbeinatree/what_the_function
like image 67
Grumbel Avatar answered Jan 02 '23 22:01

Grumbel


"For each" wouldn't have an antonym. Your question reminds me of this other riddle: "What is the opposite of a circle?"

like image 23
qoba Avatar answered Jan 02 '23 22:01

qoba