Paul Rubin <no.email@nospam.invalid> wrote:
tfb <tfb@work.it.out> writes:
No single language has 1% of constructs anyone might ever want.
If I can code fluently in a language, that is, I can think entirely
about the application-level problem I'm trying to solve and not putting
much effort into choosing language constructs, then it's supplying 100%
of what I want at least at that moment. That's great.
Here's the thing: you are one person. There are, shockingly, other people
in the world who might want to write programs. You may also have noted
that more than one programming language exists. Although you are clearly happy with whatever language it is you use and never inclined to look at anything else, perhaps some if these other languages might exist because other people might want a different set of constructs, don't you think?
I have no idea what you're talking about.
I simply accuse you of having poor reading comprehension, and even worse writing comprehension.
I simply accuse you of having poor reading comprehension, and even worse
writing comprehension.
Do you really think that a thread about language extensibility and whether any given language could have enough co structs to satisfy all posdible
users of that language had suddenly changed topic to how familiar an individual was with a given language? Really? Oh well.
Yes, because that's how human to human real world conversations work.
Being strictly /on topic/ without any deviation is a social construct invented by psychopaths for psychopaths. It's because they can't deal
with real human to human interactions, and have to /hide themselves/,
and pretend.
All. The. Time.
You are being dangerously close to expose yourself as a psychopath, so I suggest you stop replying to me, and /touch grass/ or something.
Do you really think that a thread about language extensibility and whether any given language could have enough co structs to satisfy all posdible
users of that language had suddenly changed topic to how familiar an individual was with a given language?
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
Yes, because that's how human to human real world conversations work.
Being strictly /on topic/ without any deviation is a social construct
invented by psychopaths for psychopaths. It's because they can't deal
with real human to human interactions, and have to /hide themselves/,
and pretend.
All. The. Time.
You are being dangerously close to expose yourself as a psychopath, so I
suggest you stop replying to me, and /touch grass/ or something.
I must admit to being pretty amused by how quickly some random internet buffoon, who very obviously is not a native English speaker, has moved from accusing me of poor English reading comprehension rCo and 'writing comprehension', which as a native English speaker I assume must mean 'comprehensible writing', but I dunno rCo to saying I'm about to expose myself as a psychopath because I 'can't deal with human to human interactions' (which is ... funny). (I half expect the same person is now wondering whether I'm using an LLM because of the spaced dashes. Hint:
no.)
And now, because I admit to laughing at you, it will no doubt confirm whatever pop-psychology rubbish you want to believe about people you've
never met and never will. No: quite ordinary people laugh at fools, it
turns put: there's a whole genre of comedy based on that.
So be it.
tfb <tfb@work.it.out> writes:
Do you really think that a thread about language extensibility and whether >> any given language could have enough co structs to satisfy all posdible
users of that language had suddenly changed topic to how familiar an
individual was with a given language?
Fluency does matter.
If fluency in a language lets me do most of my daily tasks with at most occasional inconvenience, I'd call the language satisfactory. Stuff
like macros make inconvenient things convenient. They don't make the impossible possible. And if the language makes enough everyday things convenient, it's ok with me if some inconvenient ones are left over.
So I haven't felt lack of macros to be a serious shortcoming of non-Lisp languages. There are usually alternate mechanisms offered, like
function decorators in Python.
Fluency does matter.
If fluency in a language lets me do most of my daily tasks with at most occasional inconvenience, I'd call the language satisfactory. Stuff
like macros make inconvenient things convenient. They don't make the impossible possible. And if the language makes enough everyday things convenient, it's ok with me if some inconvenient ones are left over.
So I haven't felt lack of macros to be a serious shortcoming of non-Lisp languages. There are usually alternate mechanisms offered, like
function decorators in Python.
There would probably be some extremists who would say, well, if only
everyone saw and understood the blinding light of (Python|Ruby|Lisp)
then they would achieve true happiness.
It should be possible to write functions in an existing language which
map constructs expressing that new (or borrowed) idea into the
existing language. Those functions have a name: macros.
tfb <tfb@work.it.out> writes:
There would probably be some extremists who would say, well, if only
everyone saw and understood the blinding light of (Python|Ruby|Lisp)
then they would achieve true happiness.
The Blub fallacy. Yes it applies to CL just like to anything else.
It should be possible to write functions in an existing language which
map constructs expressing that new (or borrowed) idea into the
existing language. Those functions have a name: macros.
Meh, if the old language can express the new idea at all, then the new
idea isn't that big of a change. Like try implementing Scheme
continuations as macros in CL.
There's a theoretical paper by Felleisen about what really adds
expressive power to programming languages. Sadly, I don't understand
it, but maybe someday.
https://www2.ccs.neu.edu/racket/pubs/scp91-felleisen.pdf
Like try implementing Scheme continuations as macros in CL.Doug Hoyte does it in Let Over Lambda.
https://www2.ccs.neu.edu/racket/pubs/scp91-felleisen.pdfCare to share what you don't understand about the paper?
Care to share what you don't understand about the paper? I suppose the >subject is still interesting to the newsgroups addressed here, though it >leans more towards comp.lang.misc and comp.theory and sci.logic.
According to secondary sources, Felleisen deems two programming
languages to be equally expressive if programs can be rewritten
into the other language, maybe using local macros (because they
are just "syntactic suger").
(slurp file-path) ; Read entire file into a string
Anton Antimo <anton@safunu.org> writes:
Like try implementing Scheme continuations as macros in CL.Doug Hoyte does it in Let Over Lambda.
I don't see how that is possible, other than by using the Turing
completeness of CL macros to implement Scheme, more or less.
Continuations automatically give you stackful coroutines and that
requires runtime support that's not built into CL. I haven't read that
book though.
// Helper to sanitize a word to lowercase alphanumeric charactersHere, it seems the variable /clean/ is completely superfluous [1].
auto sanitize = [](std::string w) {
auto clean = w | std::views::filter([](char c) { return std::isalnum(c); })
| std::views::transform([](char c) { return std::tolower(c); });
return std::string(clean.begin(), clean.end());
};
// Helper to sanitize a word to lowercase alphanumeric charactersDear Stefan,
auto sanitize = [](std::string w) {
auto clean = w | std::views::filter([](char c) { return std::isalnum(c); })
| std::views::transform([](char c) { return std::tolower(c); });
return std::string(clean.begin(), clean.end());
};
On 8/27/2026 6:47 PM, Stefan Ram wrote:
Has Bjarne thought to include PCRE2 in C++ already?-a Can we use a reg-
ular expression to match ' only if it's inside a word?-a Do we want to account for Unicode single curly quotes too?
C++ has had a regex library since C++11.
auto sanitize = [](std::string w) {Here, it seems the variable /clean/ is completely superfluous [1].
auto clean = w | std::views::filter([](char c) { return std::isalnum(c); })
| std::views::transform([](char c) { return std::tolower(c); });
return std::string(clean.begin(), clean.end());
};
Wouldn't it be much better if std::string() -- the constructor -- could
just use the filter directly? I mean, something like this, instead; un- >tested.
return std::string( w | filter | transform ) ;
auto sanitize = []( ::std::string w ) return ::std::string( w | filter |
transform ) ;
ular expression to match ' only if it's inside a word? Do we want to
account for Unicode single curly quotes too?
"Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> wrote or quoted:
Has Bjarne thought to include PCRE2 in C++ already? Can we use a reg-
ular expression to match ' only if it's inside a word? Do we want to
account for Unicode single curly quotes too?
"::std::regex" was introduced in C++11 (2011), but due to
performance problems, it's scheduled to be deprecated.
Newsgroups: comp.lang.misc,comp.lang.c++
I also have Stroustrup's 4th edition, but I'm not sure it's worth read-
ing to catch up on the latest? What do you think?
I use the word /try/ here because I'm not offhand sure a good word
counting program can be done with strictly a regular expression,
Has Bjarne thought to include PCRE2 in C++ already? Can we use a reg-
ular expression to match ' only if it's inside a word? Do we want to
account for Unicode single curly quotes too?
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote or quoted:
I use the word /try/ here because I'm not offhand sure a good wordDuring this thread I did not think about it as a real
counting program can be done with strictly a regular expression,
application, but just as a example for programming. But if
you ask me about it, the most important thing for a really
good word-counting program is one's definition of "word".
On Fri, 18 Sep 2026 11:05:46 +0800
"Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> gabbled:
Has Bjarne thought to include PCRE2 in C++ already?-a Can we use a reg-
ular expression to match ' only if it's inside a word?-a Do we want to
account for Unicode single curly quotes too?
Instead of ever niche academic circle jerking wrt C++ expansion, it
would be
nice if some more basic stuff was added first that other languages have supported since their inception. Eg, how about a switch() construct that operated on more than just POD types?
std::string mystr = "hello";
:
:
switch(mystr)
{
case "hello": ...
case "world": ...
:
}
etc.
So long as the object had operator==() defined I see no problem with overloading
switch in this way.
The amount of times I've had to write endless if-else's instead of this
I've
lost count of.
boltar@caprica.universe writes: Eg, how about a switch() construct that >>operated on more than just POD types?
Expected in C++29:
inspect (mystr) {
"hello" => { /* ... */ },
"world" => { /* ... */ },
_ => { /* default */ }
};
Why an entirely new construct, just overload switch!
Also I can guarantee than there's a ton of current code that
will already be using the word "inspect" in some way.
On 18 Sep 2026 15:25:17 GMT
ram@zedat.fu-berlin.de (Stefan Ram) gabbled:
boltar@caprica.universe writes: Eg, how about a switch() construct that >>> operated on more than just POD types?
Expected in C++29:
inspect (mystr) {
"hello" => { /* ... */ },
"world" => { /* ... */ },
_ => { /* default */ }
};
Wtf?? Why an entirely new construct, just overload switch! Also I can guarantee than there's a ton of current code that will already be using the word "inspect" in some way.
On 18/09/2026 17:49, boltar@caprica.universe wrote:
On 18 Sep 2026 15:25:17 GMT
ram@zedat.fu-berlin.de (Stefan Ram) gabbled:
boltar@caprica.universe writes:-a-a Eg, how about a switch() construct
that
operated on more than just POD types?
-a Expected in C++29:
inspect (mystr) {
-a-a-a "hello" => { /* ... */ },
-a-a-a "world" => { /* ... */ },
-a-a-a _-a-a-a-a-a-a => { /* default */ }
};
Wtf?? Why an entirely new construct, just overload switch! Also I can
guarantee than there's a ton of current code that will already be
using the
word "inspect" in some way.
"inspect" is /not/ expected in C++29 - Stefan is a bit out of date.-a It
was one of several alternative proposals for a new pattern-matching feature.-a The current candidate is "match", with a syntax like :
-a-a-a-ax match {
-a-a-a-a-a-a-a 0 => std::printf("zero");
-a-a-a-a-a-a-a 1 => std::printf("one");
-a-a-a-a-a-a-a _ => std::printf("something else");
-a-a-a-a}
This works like a normal "switch", but there is no fall-through (so no "break" statements), and it is not weirdly unstructured.
-a-a-a-as match {
-a-a-a-a-a-a-a "zero" => std::printf("zero");
-a-a-a-a-a-a-a "one" => std::printf("one");
-a-a-a-a-a-a-a _ => std::printf("something else");
-a-a-a-a}
It will work with any literal types.-a It can also be used to match
variant types, polymorphic types, etc.
And there are few situations where an existing identifier "match" could
be in conflict with the new keyword.-a (You could cause trouble with a
macro called "match", but that seems unlikely in real code.)
boltar@caprica.universe wrote or quoted:
Why an entirely new construct, just overload switch!
Switch already has fall-through semantic which is not desired
for the new inspect statement. Also parsing both the old and
the new "case" syntax can become difficult.
Also I can guarantee than there's a ton of current code that
will already be using the word "inspect" in some way.
If the compiler sees "inspect (variable) { ... }", it parses
it as a pattern-matching block.
If it sees "int inspect = 5;" or "my_object.inspect()", it treats
it as a completely valid standard identifier.
On 18 Sep 2026 16:05:52 GMT
ram@zedat.fu-berlin.de (Stefan Ram) gabbled:
boltar@caprica.universe wrote or quoted:
Why an entirely new construct, just overload switch!
Switch already has fall-through semantic which is not desired
for the new inspect statement. Also parsing both the old and
Says who?
the new "case" syntax can become difficult.
Rubbish. Other languages manage.
Also I can guarantee than there's a ton of current code that
will already be using the word "inspect" in some way.
If the compiler sees "inspect (variable) { ... }", it parses
it as a pattern-matching block.
If it sees "int inspect = 5;" or "my_object.inspect()", it treats
it as a completely valid standard identifier.
So we treat "inspect" differently to every other keyword in that it can be used as a variable/function/whatever name too? Well that won't be confusing at all!
Paul Rubin <no.email@nospam.invalid> writes:
Meh, if the old language can express the new idea at all, then the newDoug Hoyte does it in Let Over Lambda. But even if we have here a case
idea isn't that big of a change. Like try implementing Scheme >>continuations as macros in CL.
where things don't work out so well, one case won't break the efficacy
of all other cases.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 56:27:15 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,806 |