Linking Words as Conditional Statments

Started by
13 comments, last by alnite 9 years, 3 months ago
- An imperative word is a command word(verb).
- A linking word is a word that links two clauses together.

In programming an imperative word would be a function, and a linking word would be a conditional. However, the conditional statements in programming are extremely limited when compared the list of linking words.

LINKING WORDS

**Sequence**
**Result**
**Emphasis**

* First / firstly, second / secondly, third / thirdly etc
* Next, last, finally
* In addition, moreover
* Further / furthermore
* Another
* Also
* In conclusion
* To summarise

* So
* As a result
* As a consequence (of)
* Therefore
* Thus
* Consequently
* Hence
* Due to

* Undoubtedly
* Indeed
* Obviously
* Generally
* Admittedly
* In fact
* Particularly / in particular
* Especially
* Clearly
* Importantly

**Addition**
**Reason**
**Example**

* And
* In addition / additionally / an additional
* Furthermore
* Also
* Too
* As well as

* For
* Because
* Since
* As
* Because of

* For example
* For instance
* That is (ie)
* Such as
* Including
* Namely

**Contrast**
**Comparison**


* However
* Nevertheless
* Nonetheless
* Still
* Although / even though
* Though
* But
* Yet
* Despite / in spite of
* In contrast (to) / in comparison
* While
* Whereas
* On the other hand
* On the contrary

* Similarly
* Likewise
* Also
* Like
* Just as
* Just like
* Similar to
* Same as
* Compare
* compare(d) to / with
* Not only...but also

END LINKING WORDS

I am wondering if these linking words can be programmed as real statments, and how they might function. When I get home, I am going to try to simulate some with python.

Anyone have any comments on how useful or useless this would be?
If you find it useless, could you simulate some of these condtions in this current state of computer science?
If you could replicate one of these linking words, how would you do it?

I will format this post when I get on my PC.

They call me the Tutorial Doctor.

Advertisement
Here is one for First, Second Third:


## Firstly Secondly Thirdly etc
def first():
	print 'first'
def second():
	print 'second'
def third():
	print 'third'

def sequence(*args):
	args

sequence(first(),second(),third())

They call me the Tutorial Doctor.

Why would you want to do this? What are you trying to do that you can't achieve with the existing conditional operators?

All computer programs are essentially acting upon ultimately numeric data. What would "similarly" or "despite" mean in the context of comparisons of numeric data?

I have absolutely no idea what your second code snippet is trying to demonstrate.

I cant make out much sense out of this, but I feel these would be more useful in describing the properties of the system at a meta-level, something similar to unit tests or asserts or such, which would help the compiler to detect errors (or resolve ambiguities) or optimize. Basically throwing extra information at the compiler about relationships between pieces of code or data.

Eg you might give specific examples on what output the code should give for some input, or describe something in multiple different ways (provide multiple algorithms and the compiler chooses which one to use based on usage patterns etc?)

IMO there is little point in trying to find connections between real world human stuff and code, and often the opposite is more beneficial since thinking of the program in terms of real world concepts can cloud your mind since what applies in the real world probably doesnt apply in code even if you are trying to model the real world in some way.

o3o

Somewhere aroun 9/10 of the phrases you describe are just synonymous with existing programming constructs - i.e. they imply the same thing, without any additional context or restrictions implied. And you clearly are aware of this, because you have neatly grouped them by this same metric.

What do you expect to gain by offering the programmer many meaningless synonyms for the same concept?

It seems almost as silly as the difference between a while loop in C, and an until loop in perl - the addition of a not operator clearly renders each identical to the other, so why favour one over the other?

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Take, for instance, the phrase "As a consequence of..."

What does this mean? Can it be represented with existing constructs?

I take it to mean that one thing is another thing as a consequence of something else. That can be represented with if statements.

But then take "Because of."

I take this to mean that one thing is something, because something else is something else.


x == true because y == true (not if)

Of course, what does this mean to the program? With the existing conditionals, y is true WHEN x is true, but it is not true, BECAUSE y is true.

A few of these linking words I see in various languages though (while,if,then,else,for)

But I don't see how I would program DESPITE.


x == true despite y:

I guess this is basically meaning that x is a constant, and will remain a constant, despite anything. In swift this is like the LET keyword. Immutable?

But it does seem like the general consensus so far is that most of these are useless.

They call me the Tutorial Doctor.


I cant make out much sense out of this, but I feel these would be more useful in describing the properties of the system at a meta-level, something similar to unit tests or asserts or such, which would help the compiler to detect errors (or resolve ambiguities) or optimize. Basically throwing extra information at the compiler about relationships between pieces of code or data.

I didn't think of that! I think I can use python error handling to model some of these (if there aren't ways already)

I mean, people do create custom keywords for this purpose.

They call me the Tutorial Doctor.


It seems almost as silly as the difference between a while loop in C, and an until loop in perl - the addition of a not operator clearly renders each identical to the other, so why favour one over the other?

Hmm. I haven't done C or perl programming (yet).

But taking the two keywords "while" and "until" as they are, I think they imply two different things. But I see what you mean:


Bake a cake until it is hot
or
Bake a cake while it is not hot

I guess I am a little interested in semantics in computer programming, and how that relates to the syntax of a particular programming language. What better way to understand what the program is doing?

I would like to weed out the meaningless ones, and see if there are some that might be unique.

Edit: Wow, semantics in computer programming is actually a thing, and it is centered around finding out what the programming is doing, and writing good compilers!

http://en.wikipedia.org/wiki/Semantics_(computer_science)

IN SUMMARY:

  1. It has close links with other areas of computer science such as programming language design, type theory, compilers and interpreters, program verification and model checking.
  2. In programming language theory, semantics is the field concerned with the rigorous mathematical study of the meaning of programming languages.
  3. It does so by evaluating the meaning of syntactically legal strings defined by a specific programming language, showing the computation involved.
  4. Semantics describes the processes a computer follows when executing a program in that specific language.
  5. The distinctions between the three broad classes of approaches can sometimes be vague, but all known approaches to formal semantics use the above techniques, or some combination thereof.
  6. Apart from the choice between denotational, operational, or axiomatic approaches, most variation in formal semantic systems arises from the choice of supporting mathematical formalism.
  7. This can be shown by describing the relationship between the input and output of a program, or an explanation of how the program will execute on a certain platform, hence creating a model of computation.
  8. For a variety of reasons, one might wish to describe the relationships between different formal semantics.
  9. It is also possible to relate multiple semantics through abstractions via the theory of abstract interpretation.
  10. In such a case that the evaluation would be of syntactically illegal strings, the result would be non-computation.

They call me the Tutorial Doctor.

You have to keep in mind that natural languages are rather universal in their purpose. They can be used to give orders but they can also be used to explain stuff and transfer knowledge. (Most) programming languages only serve a single purpose: give orders. You don't need to explain to the CPU why it should do s.th.

Hence, many of those linking words have no purpose in a programming language. In a language that describes knowledge (see ontology) things might be different.

In my humble opinion it's an attempt to make c more programmer friendly, but at the same time confuses me a bit, because the existing methodologies are so know as riding a bike.

It also depends ofcourse on how logical the variable names are

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement