Questions tagged [semantics]

The study of meaning as it applies to programming languages

Semantics is the study of meaning. In computer programming, semantics refers to the relationships between symbols in a programming language, and how those symbols are combined and manipulated to produce a computing result.

Useful links

1650 questions
37
votes
6 answers

Which HTML tags are more appropriate for money?

If you had to properly choose one HTML tag to represent a price, a money amount or an account balance, (e.g. 3/9/2012 - Income: 1.200,00 € or item #314159 - price: $ 31,99) then which tag would you choose for the amount and why? should the currency…
Fabrizio Calderan loves trees
  • 109,094
  • 24
  • 154
  • 160
37
votes
3 answers

What happens to you if you break the monad laws?

Do the compiler or the more "native" parts of the libraries (IO or functions that have access to black magic and the implementation) make assumptions about these laws? Will breaking them cause the impossible to happen? Or do they just express a…
Owen
  • 36,566
  • 13
  • 87
  • 116
36
votes
4 answers

Double quotes vs single quotes in JavaScript

Possible Duplicate: When to Use Double or Single Quotes in JavaScript Are there differences between ' and " I am wondering if there is a difference between using single quotes vs double quotes in JavaScript (JQuery selectors etc.). Both seem to…
TGH
  • 37,121
  • 10
  • 94
  • 126
33
votes
2 answers

Semantic HTML markup for FAQs

I want to build a questions and answers page. It is not a list, it is not tabular data and I am not sure if or how I should use
. What is the best semantic way to build it and to format it with css?
Raanan Avidor
  • 3,323
  • 4
  • 23
  • 32
32
votes
9 answers

When to use the terms "delimiter," "terminator," and "separator"

What are the semantics behind usage of the words "delimiter," "terminator," and "separator"? For example, I believe that a terminator would occur after each token and a separator between each token. Is a delimiter the same as either of these, or…
Tim Lehner
  • 13,860
  • 4
  • 51
  • 72
32
votes
5 answers

Modern C++ approach for providing optional arguments

Let's take the following function declaration: void print(SomeType const* i); Here, the const* nature of the argument i suggest the intent, that the parameter is optional, since it may be nullptr. If this was not intended, the argument would…
Reizo
  • 1,062
  • 8
  • 15
32
votes
12 answers

Does an algorithm exist to help detect the "primary topic" of an English sentence?

I'm trying to find out if there is a known algorithm that can detect the "key concept" of a sentence. The use case is as follows: User enters a sentence as a query (Does chicken taste like turkey?) Our system identifies the concepts of the sentence…
rockit
  • 329
  • 1
  • 3
  • 4
32
votes
7 answers

What does the word "semantic" mean in Computer Science context?

I keep coming across the use of this word and I never understand its use or the meaning being conveyed. Phrases like... "add semantics for those who read" "HTML5 semantics" "semantic web" "semantically correctly way to..." ... confuse me and I'm…
Hristo
  • 42,002
  • 60
  • 155
  • 224
32
votes
4 answers

Should I fix Xcode 5 'Semantic issue: undeclared selector'?

I'm trying to upgrade my app with Xcode5 but encountered a number of 'Semantic issues' in a third party library (being MagicalRecord). The quickest way to 'fix' this might be using the: #pragma GCC diagnostic ignored "-Wundeclared-selector" (from:…
iOS-Coder
  • 1,181
  • 1
  • 14
  • 28
31
votes
14 answers

Semantic difference between "Find" and "Search"?

When building an application, is there any meaningful difference between the idea of "Find" vs "Search" ? Do you think of them more or less as synonymous? I'm asking in terms of labeling for application UI as well as API design.
Larsenal
  • 45,294
  • 40
  • 140
  • 210
30
votes
6 answers

When to use
line breaks vs CSS positioning?

I've often wondered about the proper use of a
line break. Seems that often they are incorrectly used for positioning or clearing content where CSS should instead be used. W3schoools.org says to use
for blank lines, but not for creating…
brandonjp
  • 2,938
  • 2
  • 26
  • 27
30
votes
7 answers

Is there any killer application for Ontology/semantics/OWL/RDF yet?

I got interested in semantic technologies after reading a lot of books, blogs and articles on the net saying that it would make data machine-understandable, allow intelligent agents make great reasoning, automated & dynamic service composition…
user304867
  • 317
  • 3
  • 3
29
votes
1 answer

"Strictly positive" in Agda

I'm trying to encode some denotational semantics into Agda based on a program I wrote in Haskell. data Value = FunVal (Value -> Value) | PriVal Int | ConVal Id [Value] | Error String In Agda, the direct translation…
Jason Reich
  • 1,168
  • 9
  • 15
28
votes
6 answers

Does a pure method have to be static?

I'm working through a textbook at the moment which defines a pure method as: "a static method that depends only on its parameters and no other data" Would it not be possible to have an instance method be a pure method without it being static (as…
Josh Hardman
  • 615
  • 6
  • 17
27
votes
6 answers

Why does (x += x += 1) evaluate differently in C and Javascript?

If the value of the variable x is initially 0, the expression x += x += 1 will evaluate to 2 in C, and to 1 in Javascript. The semantics for C seems obvious to me: x += x += 1 is interpreted as x += (x += 1) which is, in turn, equivalent to x +=…
KT.
  • 9,166
  • 3
  • 38
  • 65