Click here to Skip to main content

Welcome to the Lounge

   

For lazing about and discussing anything in a software developer's life that takes your fancy.
The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct and please don't post ads.

Technical discussions are welcome, but if you need specific help please use the programming forums.


 
GeneralRe: So how did you get stuck in your career, anyway? PinmemberGary Wheeler17-Dec-13 6:47 
GeneralRe: So how did you get stuck in your career, anyway? Pinmemberdevenv.exe17-Dec-13 7:30 
GeneralRe: So how did you get stuck in your career, anyway? PinmemberRoger Wright17-Dec-13 8:42 
GeneralRe: So how did you get stuck in your career, anyway? PinprofessionalRavi Bhavnani17-Dec-13 8:56 
GeneralRe: So how did you get stuck in your career, anyway? Pinmembertxmrm17-Dec-13 10:40 
GeneralRe: So how did you get stuck in your career, anyway? PinprofessionalRavi Bhavnani17-Dec-13 10:43 
GeneralRe: So how did you get stuck in your career, anyway? PinprofessionalMycroft Holmes17-Dec-13 13:22 
GeneralIs there a programming language... PinprotectorMarc Clifton17-Dec-13 4:28 
...that works "easily" with semantic types? For example, I may have:
 
int age = 51;
 
which completely loses the concept that 51 is an age (in years). What I want is something like:
 
AgeInYears myAge = 51;
 
and yet still be able to specify that I can perform, say, arithmetic operations on "myAge". For example, in C#, I could write:
 
class AgeInYears
{
  public int Value {get;set;}
}
 
... implement operators on AgeInYears
 
 
But that gets messy real fast - every "semantic type" needs these operators, etc.
 
Furthermore, the unit of measurement is still not handled very elegantly.
 
So, as the question states, are there programming languages out there that are more expressive of semantic types?
 
Marc

GeneralRe: Is there a programming language... PinmemberMaximilien17-Dec-13 4:37 
GeneralRe: Is there a programming language... PinprotectorMarc Clifton17-Dec-13 5:02 
GeneralRe: Is there a programming language... PinprotectorPete O'Hanlon17-Dec-13 4:37 
GeneralRe: Is there a programming language... PinprotectorMarc Clifton17-Dec-13 4:40 
GeneralRe: Is there a programming language... PinprotectorPete O'Hanlon17-Dec-13 4:50 
GeneralRe: Is there a programming language... PinprofessionalRon Beyer17-Dec-13 4:37 
GeneralRe: Is there a programming language... PinmemberJohnny J.17-Dec-13 4:41 
JokeRe: Is there a programming language... PinprofessionalRon Beyer17-Dec-13 4:43 
GeneralRe: Is there a programming language... PinmemberJohnny J.17-Dec-13 4:49 
GeneralRe: Is there a programming language... PinprotectorMarc Clifton17-Dec-13 4:41 
GeneralRe: Is there a programming language... PinprofessionalRon Beyer17-Dec-13 4:49 
GeneralRe: Is there a programming language... PinprotectorMarc Clifton17-Dec-13 5:09 
GeneralRe: Is there a programming language... PinmemberGary Wheeler17-Dec-13 6:55 
GeneralRe: Is there a programming language... PinmemberSortaCore17-Dec-13 22:08 
GeneralRe: Is there a programming language... PinmemberGary Wheeler18-Dec-13 0:36 
GeneralRe: Is there a programming language... PinprofessionalPIEBALDconsult17-Dec-13 5:39 
GeneralRe: Is there a programming language... PinmemberBillWoodruff17-Dec-13 10:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 20 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid