|
|
I wish I could make my own keywords #3
Think for a moment about the compiler checking const correctness adds.
Then, imagine a c++ with a syntax where we could create our own 'const'
like qualifier keywords.
In a multi threaded development environment one could imagine wanting to
declare a 'threadsafe' qualifier.
declare_qualifier threadsafe;
threadsafe would be a qualifier for methods - methods qualified as
threadsafe would cause compiler errors if they attempted to call non
threadsafe qualified methods.
Or, in the context of processing data from the user
declare_qualifier unsanitized;
Now, with some 'rules', we could create a keyword that would be used to
guard data directly entered by the user, and functions that work on that
data. Functions not expecting unsanitzed data would be disallowed from
reading or writing to unsanitized variables.
Conversion functions would use casting, and actual data parsing, to move
the data from a unsanitized into a 'sanitized' (or non-unsanitized)
buffer at which point it could be passed safely to SQL or other layers
in the app that are not so careful about what they process.
Im sure these are not the only two uses possible for custom qualifiers,
and the rules for each one, to work in their role successfully, would
have to have some way of being specified. But its time I think that
compiers tried harder to allow programmers to write 'correct' software
using tools more versatile than just 'const'.
|
|
0
|
|
|
|
Reply
|
chris.becke (32)
|
9/17/2009 7:24:18 AM |
|
On Sep 17, 3:24=A0am, Chris Becke <chris.be...@gmail.com> wrote:
> Think for a moment about the compiler checking const correctness adds.
> Then, imagine a c++ with a syntax where we could create our own 'const'
> like qualifier keywords. [...]
You might find this interesting:
http://www.artima.com/cppsource/codefeatures.html
Sean
|
|
0
|
|
|
|
Reply
|
sean_in_raleigh (45)
|
9/17/2009 2:34:06 PM
|
|
|
1 Replies
29 Views
(page loaded in 0.045 seconds)
Similiar Articles: Game programming on calculator - comp.sys.hp48Hello folks and sorry for my poor english. I wish to learn how ... more than a simple learning of the new keywords ... For Beginners: I've heard that you can make your own ... X10 PC Interface upgrade - comp.home.automationThanks. I wish though you could have given it a more enthusiastic endorsment. ... sony ericsson Sony Ericsson Xperia X10 Android 2.2 Upgrade ... added its own ... Need help with map projection conversion in ENVI - comp.lang.idl ...IN_MEMORY keyword is not allowed in this routine (seems strange..), so I use the OUT ... Thanks, Robin -- I wish it was that simple. The first ' got lost when I did some ... Volume Rendering - comp.graphics.api.openglI wish you good luck. --George "RSR" <rsr@sys ... > The biggest data set I could play on my computer GForce4200 ... Keywords: volume visualization, volume rendering ... Question for very experienced SAS programmers - comp.soft-sys.sas ...> > Alan Hi, I wish I had a little more time, you asked a very interesting ... Groups ... out there tell me what I have missed?Thank Q very much ... to create my own ... remembering save folder - comp.graphics.apps.paint-shop-pro ...... File > Open folder, but the optimizers under File > Export remember their own ... I'd > much appreciate it. > > Thanks. > I wish I could enlighten you, but you are ... Preventing A New Window From Grabbing Focus - comp.lang.java ...It'll> be used on Windows and other versions of Linux.>> HalI wish I could ... all the time) I came up with all kinds of crazy schemes to make it work. I made my own ... define a derived type for an array in Fortran? And define ...But suppose I want to use TYPE to define my own type of say an real array of some ... More like I'm saying that I wish the language didn't allow some of this. looking for a RPG with low system requirements - comp.sys.ibm.pc ...I really envy you! You could go out and play Planescape: Torment for the very first time. if you just wanted. I wish i could do that again. CP/M 3 DRI manual under construction - comp.os.cpm... others" who have reconstructed their own ... I could imagine someone might make a CP/M 3.0 "help" system using text-only files ... to finish this project, but I really wish I ... Real Wishes Granted ~ Make A Real Wish Come True ~ Real Wish Comes ...2 After you submit your wish, you will immediately be directed to your very own and unique "Wish Page" - ... What do I need to do to make my wish come true? 13. Why 8,888 ... Obama: 'I'd like to work my way around Congress' | Campaign 2012 ..."As I mentioned when I was at La Raza a few weeks back, I wish I had a magic wand and could make this all happen on my own," Obama told a meeting of the Congressional ... » 20 Things I Wish I Had Known When Starting Out in Life :zenhabitsWell, I’m in my 30s now and I wish I could slap that little 18-year-old Leo around a bit. ... I had to make my own mistakes, and live my own life. And that’s what I did ... WishWishWishStill, I wore the most magical outfit I could find in my ... Working on a piece for Wish (yes, working on your own magazine has it’s perks!), my partner in crime Lucy ... I wish I had a monkey.I wish I Had a Monkey; Simon's Pie Charts ... potters wheel and kiln and produce my own range of contemporary, modern living, statues of monkeys. I could make a cast of my ... 6/20/2012 5:35:14 AM
|
|
|
|
|
|
|
|
|