473,803 Members | 3,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

syntax suggestion for concepts

Would the fear factor for concepts be slightly reduced if,
instead of:

concept C<typename T>
{
typename T::S;
int T::mem();
int nonmem();
};

a new usage of :: was added to make concepts/
concept maps more consistent with class interfaces:

concept C<typename T>
{
typename S
int mem();
int ::nonmem();
};

A perhaps bad aspect of this is that multi-type
concepts could ONLY specify names prefixed with ::,
that is, this under the existing proposal:

concept D<typename U, typename V>
{
int U::umem();
int uandv(U u, V v);
};

would have to be changed to something like:

concept DD<typename U>
{
int umem();
};
concept D<typename U, typename V: DD<U>
{
int ::uandv();
};

(Or, the one reserve word "concept" could be
replaced with two: "algebra" for single-type
concepts, and "geometry" for multi-type
concepts. This would avoid the ubiquitous
:: in geometries.)

For orthogonality, this use of :: could be allowed in
class interfaces as well. Concepts and class interfaces
are both ways of describing type usage, so it seems
more intuitive to me that they be as similar as
possible.

Feb 25 '07
20 2601
[Note: either groups.google.c om or the comp.std.c++ moderation SW
appears to be eating messages, so this may wind up being a
repetitive posting.]

On Mar 20, 4:30 pm, d...@boost-consulting.com (David Abrahams) wrote:
on Tue Mar 20 2007, "W Karas" <wkaras-AT-yahoo.comwrote:
..
If you look at an algorithm like find, yes, it does have two
type parameters. But the only possible multiple dispatch case
is the call to operator != (RT a, T b) where RT is the return
type of the iterator's 'operator *' and T is the type of the
sought value. I would guess that, in the great majority
of situations where 'find' is used, T is the same as RT, or
an instance of T implicitly converts to RT, so there is no
true multiple dispatch.

I don't really see what that proves. T is not always the same as RT.
And then there's find_if, transform, accumulate, lower_bound, and a
whole slew of other algorithms with more complicated type
relationships.
I can only say this doesn't seem to jive with the usage of
templates that I personally have seen. Not much point in
arguing about guesstimates of statistical frequency of
patterns in the "general population" of code.
Maybe multiple dispatch does occur frequently when using
templates. But if GP is just OO with multiple dispatch and earlier
bindings,

It isn't. Did somebody claim it was?
I did. I tend to use the term "OO polymorphism" to cover
the idea of writing code that is only bound to a class
interface subset, regardless of whether the interface
subset is explicit or implicit. I realize that's
different for how this term in normally used in
the C++ realm, but then, what term should be used
for the more general idea?
>
that doesn't justify viewing GP and OO as being in some
huge all-important cage-match dichotomy in my opinion.

Whoosh! That went right over my head; I have no clue what you're
trying to say here.
This subthread was originally about whether the syntax
for Concepts should be very different from the
class declaration syntax, in order to emphasize
the difference between a Concept and a base class,
and the general difference between GP and OO.

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:st*****@ ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Mar 21 '07 #21

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
34274
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
12
1544
by: Steven Bethard | last post by:
The poll, as stated, asked voters to vote for the syntax suggestion they liked the /most/. Some of the conclusions people are trying to draw from it are what syntaxes people liked the /least/. This is probably not the right conclusion to be drawing from the poll that was given. It is, however, the kind of conclusion I think we'd like to draw. I'm not sure we're going to agree fully on a single "best" proposal, but it would help to...
29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
23
2542
by: Carter Smith | last post by:
http://www.icarusindie.com/Literature/ebooks/ Rather than advocating wasting money on expensive books for beginners, here's my collection of ebooks that have been made freely available on-line by their authors. There are lots of them out there but this selection cuts out the junk. If you know of any other good books that are freely available please post a link to them here and I'll consider adding them to the site.
18
2951
by: robert | last post by:
Using global variables in Python often raises chaos. Other languages use a clear prefix for globals. * you forget to declare a global * or you declare a global too much or in conflict * you have a local identical variable name and want to save/load it to/from the global with same name * while you add code, the definition of globals moves more and more apart from their use cases -> weirdness; programmers thinking is fragmented * using...
13
3038
by: usenet | last post by:
How and where can one find out about the basics of VB/Access2003 syntax? I am a died in the wool C/C++/Java Linux/Unix programmer and I am finding it difficult to understand the program format for accessing objects, controls, etc. in VB/Access2003. In particular where will I find explanations of:- Actions, Functions, Methods, Properties - I'm understand the
17
1895
by: Howard Gardner | last post by:
/* If I am using boost, then how should I write this program? As it sits, this program is using SFINAE to determine whether or not a type supports particular syntax. I suspect that there is functionality in boost to do this. I have found mpl::has_xxx, which I suspect of being part of the solution. I've also found type_traits::has_nothrow_constructor
4
10747
by: FM | last post by:
Hi there: My question is about checking my sql-syntax against DB2UDB V9 throug JDBC 2.0 Is there a way to check my syntax,for example "select * from T1"? Thank you for your help. Regards,
0
10316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.