David Brown <david.brown@hesbynett.no>: Jun 19 09:12PM +0200 On 19/06/18 16:52, Chris Vine wrote: > macro in C, if that is by using a different technique from the one I > mentioned. I am still stuck on C89/90 as far as C pre-processors are > concerned.) #define make_max(name, type) \ static inline type max_ ## name (type a, type b) { return a > b ? a : b; } make_max(char, char) make_max(uchar, unsigned char) make_max(schar, signed char) make_max(short, short) make_max(ushort, unsigned short) make_max(int, int) make_max(uint, unsigned int) make_max(long, long) make_max(ulong, unsigned long) make_max(llong, long long) make_max(ullong, unsigned long long) make_max(float, float) make_max(double, double) make_max(ldouble, long double) #define max(a, b) _Generic((a), \ char : max_char, unsigned char : max_uchar, signed char : max_schar, \ short : max_short, unsigned short : max_ushort, \ int : max_int, unsigned int : max_int, \ long : max_long, unsigned long : max_ulong, \ long long : max_llong, unsigned long long : max_ullong, \ float : max_float, double : max_double, long double : max_ldouble \ )(a, b) |
David Brown <david.brown@hesbynett.no>: Jun 19 09:13PM +0200 On 19/06/18 21:00, Robert Wessel wrote: >> minimum operators a?b and a?b would be an option with existing practice, >> but which would be equally unknown to almost everyone. > Old HP-2000 BASIC just used MIN and MAX as the binary infix operators. You can persuade C++ to use MIN and MAX as binary infix operators. I am far from convinced it would be a good idea, but it is possible. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jun 19 09:54PM +0200 On 19.06.2018 18:18, Keith Thompson wrote: > symbol means "min". > I would oppose defining either "a ∨ b" or "a \/ b" as min(a, b) > because it's apparently the opposite of mathematical usage. Both are good points. But let's look at things from the boolean operations point of view. I'd like "or" (and operator "||" which means the same) to just mean "max". That way it would work nicely with three-value boolean logic. Like, false, maybe and true as 0, 1 and 2. E.g. or( false, maybe) == max( false, maybe ) == maybe. > I'm not at all convinced that min and max operators, with whatever > syntax, are worth adding to the language at all. If they were to be > added, agreeing on a syntax would be difficult. Maybe the time has come for more Unicode symbols in programming languages. Just not all the way to APL... Cheers! - Alf |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Jun 19 09:28PM +0100 On Tue, 19 Jun 2018 21:12:11 +0200 > long long : max_llong, unsigned long long : max_ullong, \ > float : max_float, double : max_double, long double : max_ldouble \ > )(a, b) Thanks, that's interesting. So far as I understand it comprises a macro which constructs a series of inline functions, which is combined with another generic macro which calls one of them, depending on type. Somewhat like a template function in C++ but with more boilerplate. The macros themselves would still be unhygienic but that wouldn't matter here. |
Robert Wessel <robertwessel2@yahoo.com>: Jun 19 02:00PM -0500 On Tue, 19 Jun 2018 20:26:31 +0200, David Brown >such as the old gcc <? and >? operators. Perhaps APL's maximum and >minimum operators a?b and a?b would be an option with existing practice, >but which would be equally unknown to almost everyone. Old HP-2000 BASIC just used MIN and MAX as the binary infix operators. I also remember another language, which I can't remember right now, that also had binary infix MIN and MAX operators, but used them in the reverse sense (a MAX 10) would be interpreted as use A, but with a maximum value of 10, so in effect it was what was more commonly MIN IIRC, it also had more conventional MIN() and MAX() functions. Presumably I remember that because it bit me on the posterior. Probably not very applicable to C. |
Lynn McGuire <lynnmcguire5@gmail.com>: Jun 19 01:17PM -0500 "What's all the C Plus Fuss? Bjarne Stroustrup warns of dangerous future plans for his C++" https://www.theregister.co.uk/2018/06/18/bjarne_stroustrup_c_plus_plus/ "Language creator calls proposals 'insanity'" Hat tip to: https://www.codeproject.com/script/Mailouts/View.aspx?mlid=13685&_z=1988477 Lynn |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jun 19 08:20PM +0100 On 19/06/2018 20:02, Rick C. Hodgin wrote: > The world sees Christianity as a religion, Leigh. It's not at all > what I'm talking about. I'm talking about forgiveness of sin through > the atoning sacrifice of Jesus Christ at the cross. Christianity is a religion mate. /Flibble -- "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jun 19 12:35PM -0700 On Tuesday, June 19, 2018 at 3:20:55 PM UTC-4, Mr Flibble wrote: > > what I'm talking about. I'm talking about forgiveness of sin through > > the atoning sacrifice of Jesus Christ at the cross. > Christianity is a religion mate. There's more to the truth of who Jesus is than your gainsaying reply. If you ever want to seek the truth, Leigh, you will find it. All who seek the truth do. The rest will perish in their arrogance. -- Rick C. Hodgin |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jun 19 05:50PM +0100 On 19/06/2018 17:42, Rick C. Hodgin wrote: > If you have any desire to communicate with me, and I with you, then > remove profanity from your posts. > I'm fine with your decision either way, Lew. OMFG, what profanity you egregious cunt of a cock womble? /Flibble -- "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Bryne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
nospam <nospam@nospam.invalid>: Jun 19 03:52PM -0400 > >half is incredibly good for a product that's been out for ~3 years. > Given the other makers a bit players and the watches hard to get hold of in > a lot of markets it should be way more than half. no. the reality is that your claim that the watch is a flop is simply wrong. it's *very* successful. > >> And thats just one model. > >no, that's *not* just one model. > Ok, one range out of many. and over 35 years. > >that's 100 million *total* since 1981, more than 35 years ago. > Actualy its 1983 and the original g shock sold very few. the article you linked stated it began in 1981 with the first product shipping in 1983, not that a difference of 2 years matters. > And I wonder what > the chances of the apple watch still being around in 35 years are? Or even > apple? that also does not matter. you're all over the map. > Its not written in lowercase either. And if you don't believe I use OS/X why > not going and look up the posts I made in comp.unix.programmer about OS/X > systems programming. i didn't say how it was written, other than what you wrote is wrong. |
nospam <nospam@nospam.invalid>: Jun 19 03:52PM -0400 > >who decides what is real work and what is not. > So fill us in on what it is you do as a job then? My guess is you don't have > one, you're a student. you'd be wrong and this is not about me. > And its clear that you have no idea how real work most often requires decent > input devices. There's a reason Windows 8 flopped big time on the desktop, why > not go find out why. you don't get to decide what real work is for everyone. as for win8, it flopped for a few reasons, which you don't appear to understand at all, ultimately forcing steve ballmer to 'retire' (aka fired). |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment