Re: Command line globber/tokenizer library for C?

Liste des GroupesRevenir à cl c 
Sujet : Re: Command line globber/tokenizer library for C?
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.c
Date : 12. Sep 2024, 16:16:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbut32$99cr$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 12/09/2024 14:44, Bart wrote:
On 12/09/2024 13:20, Janis Papanagnou wrote:
On 12.09.2024 13:29, Bart wrote:
On 12/09/2024 03:22, Bonita Montero wrote:
Am 11.09.2024 um 22:19 schrieb Bart:
>
C++ is a simpler language? You're having a laugh!
>
The solutions are simpler because you've a fifth of the code as in C.
>
In this case, it actually needed somewhat more code, even if the line
count was half.
>
But your solutions are always incomprehensible because they strive for
the most advanced features possible.
>
I don't know of the other poster's solutions. But a quick browse seems
to show nothing incomprehensible or anything that should be difficult
to understand. (YMMV; especially if you're not familiar with C++ then
I'm sure the code may look like noise to you.)
>
In the given context of C and C++ I've always perceived the features
of C++ to add to comprehensibility of source code where the respective
C code required writing clumsy code and needed (unnecessary) syntactic
ballast to implement similar functions and program constructs.
>
Your undifferentiated complaint sounds more like someone not willing
to understand the other concepts or have a reluctance or laziness to
make yourself familiar with them.
 I'm saying it's not necessary to use such advanced features to do some trivial parsing.
 I've given a C solution below.
BTW here are the sources sizes for the tokeniser function. (For C++ I've included the 'using' statement.)
              Spaces    Hard tabs
  C++         829       682         characters
  C           959       634
  M           785       548         (My original of the C version)
So my C version is actually smaller than the C++ when using hard tabs.
In any case, the C++ is not significantly smaller than the C, and certainly not a fifth the size.
For proper higher level solutions in different languages, below is one of mine. That function is 107 bytes with hard tabs.
(It's not possible to just split the string on white space because of quoted items with embedded spaces.)
-------------------------------
func strtoargs(cmdline)=
     args::=()
     sreadln(cmdline)
     while k:=sread("n") do
         args &:= k
     od
     args
end
println strtoargs(getcommandlinea())

Date Sujet#  Auteur
10 Sep 24 * Command line globber/tokenizer library for C?110ted@loft.tnolan.com (Ted Nolan
10 Sep 24 +* Re: Command line globber/tokenizer library for C?2Lawrence D'Oliveiro
10 Sep 24 i`- Re: Command line globber/tokenizer library for C?1Keith Thompson
10 Sep 24 +* Re: Command line globber/tokenizer library for C?2Janis Papanagnou
11 Sep 24 i`- Re: Command line globber/tokenizer library for C?1ted@loft.tnolan.com (Ted Nolan
10 Sep 24 +* Re: Command line globber/tokenizer library for C?2Keith Thompson
11 Sep 24 i`- Re: Command line globber/tokenizer library for C?1ted@loft.tnolan.com (Ted Nolan
11 Sep 24 +* Re: Command line globber/tokenizer library for C?2Kenny McCormack
11 Sep 24 i`- Re: Command line globber/tokenizer library for C?1ted@loft.tnolan.com (Ted Nolan
11 Sep 24 +* Re: Command line globber/tokenizer library for C?97Bonita Montero
11 Sep 24 i+* Re: Command line globber/tokenizer library for C?3ted@loft.tnolan.com (Ted Nolan
11 Sep 24 ii`* Re: Command line globber/tokenizer library for C?2Bonita Montero
11 Sep 24 ii `- Re: Command line globber/tokenizer library for C?1ted@loft.tnolan.com (Ted Nolan
11 Sep 24 i+- Re: Command line globber/tokenizer library for C?1Bart
11 Sep 24 i`* Re: Command line globber/tokenizer library for C?92Kenny McCormack
11 Sep 24 i `* Re: Command line globber/tokenizer library for C?91Bonita Montero
11 Sep 24 i  +- Re: Command line globber/tokenizer library for C?1Kenny McCormack
11 Sep 24 i  +* Re: Command line globber/tokenizer library for C?13ted@loft.tnolan.com (Ted Nolan
11 Sep 24 i  i`* Re: Command line globber/tokenizer library for C?12Keith Thompson
12 Sep 24 i  i `* Re: Command line globber/tokenizer library for C?11ted@loft.tnolan.com (Ted Nolan
12 Sep 24 i  i  +* Re: Command line globber/tokenizer library for C?8Keith Thompson
12 Sep 24 i  i  i`* Re: Command line globber/tokenizer library for C?7ted@loft.tnolan.com (Ted Nolan
12 Sep 24 i  i  i `* Re: Command line globber/tokenizer library for C?6Kenny McCormack
12 Sep 24 i  i  i  `* Re: Command line globber/tokenizer library for C?5ted@loft.tnolan.com (Ted Nolan
12 Sep 24 i  i  i   `* Columbia (Was: Command line globber/tokenizer library for C?)4Kenny McCormack
12 Sep 24 i  i  i    `* Re: Columbia (Was: Command line globber/tokenizer library for C?)3Michael S
12 Sep 24 i  i  i     +- Re: Columbia (Was: Command line globber/tokenizer library for C?)1David Brown
13 Sep 24 i  i  i     `- Re: Columbia (Was: Command line globber/tokenizer library for C?)1Lawrence D'Oliveiro
12 Sep 24 i  i  +- Re: Command line globber/tokenizer library for C?1Lawrence D'Oliveiro
12 Sep 24 i  i  `- Re: Command line globber/tokenizer library for C?1Ben Bacarisse
11 Sep 24 i  `* Re: Command line globber/tokenizer library for C?76Bart
12 Sep 24 i   `* Re: Command line globber/tokenizer library for C?75Bonita Montero
12 Sep 24 i    `* Re: Command line globber/tokenizer library for C?74Bart
12 Sep 24 i     +* Re: Command line globber/tokenizer library for C?19Kenny McCormack
12 Sep 24 i     i+* Re: Command line globber/tokenizer library for C?17Janis Papanagnou
12 Sep 24 i     ii`* Other programming languages (Was: Command line globber/tokenizer library for C?)16Kenny McCormack
12 Sep 24 i     ii `* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)15Bonita Montero
12 Sep 24 i     ii  `* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)14Kenny McCormack
12 Sep 24 i     ii   `* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)13Bonita Montero
12 Sep 24 i     ii    `* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)12Janis Papanagnou
12 Sep 24 i     ii     +* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)2Bonita Montero
12 Sep 24 i     ii     i`- Re: Other programming languages (Was: Command line globber/tokenizer library for C?)1Janis Papanagnou
13 Sep 24 i     ii     `* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)9Lawrence D'Oliveiro
13 Sep 24 i     ii      +* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)3James Kuyper
13 Sep 24 i     ii      i`* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)2Lawrence D'Oliveiro
13 Sep 24 i     ii      i `- Re: Other programming languages (Was: Command line globber/tokenizer library for C?)1Michael S
13 Sep 24 i     ii      +* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)4Janis Papanagnou
13 Sep 24 i     ii      i+* Re: Other programming languages (Was: Command line globber/tokenizer library for C?)2Lawrence D'Oliveiro
13 Sep 24 i     ii      ii`- Re: Other programming languages (Was: Command line globber/tokenizer library for C?)1Janis Papanagnou
13 Sep 24 i     ii      i`- Re: Other programming languages (Was: Command line globber/tokenizer library for C?)1Kaz Kylheku
13 Sep 24 i     ii      `- Re: Other programming languages (Was: Command line globber/tokenizer library for C?)1Kaz Kylheku
12 Sep 24 i     i`- Re: Command line globber/tokenizer library for C?1Bonita Montero
12 Sep 24 i     +* Re: Command line globber/tokenizer library for C?53Janis Papanagnou
12 Sep 24 i     i+* Re: Command line globber/tokenizer library for C?38Bart
12 Sep 24 i     ii+* Re: Command line globber/tokenizer library for C?5Bart
12 Sep 24 i     iii+- Re: Command line globber/tokenizer library for C?1Bonita Montero
12 Sep 24 i     iii`* Re: Command line globber/tokenizer library for C?3Janis Papanagnou
12 Sep 24 i     iii `* Re: Command line globber/tokenizer library for C?2Bart
12 Sep 24 i     iii  `- Re: Command line globber/tokenizer library for C?1Bonita Montero
12 Sep 24 i     ii`* Re: Command line globber/tokenizer library for C?32Michael S
12 Sep 24 i     ii +- Re: Command line globber/tokenizer library for C?1Michael S
12 Sep 24 i     ii `* Re: Command line globber/tokenizer library for C?30Bart
12 Sep 24 i     ii  `* Re: Command line globber/tokenizer library for C?29Bonita Montero
12 Sep 24 i     ii   +- Re: Command line globber/tokenizer library for C?1Kenny McCormack
12 Sep 24 i     ii   `* Re: Command line globber/tokenizer library for C?27Michael S
13 Sep 24 i     ii    +* Re: Command line globber/tokenizer library for C?8Bonita Montero
13 Sep 24 i     ii    i`* Re: Command line globber/tokenizer library for C?7Michael S
13 Sep 24 i     ii    i `* Re: Command line globber/tokenizer library for C?6Bonita Montero
13 Sep 24 i     ii    i  +* Re: Command line globber/tokenizer library for C?2Michael S
13 Sep 24 i     ii    i  i`- Re: Command line globber/tokenizer library for C?1Bonita Montero
14 Sep 24 i     ii    i  `* Re: Command line globber/tokenizer library for C?3Lawrence D'Oliveiro
14 Sep 24 i     ii    i   `* Re: Command line globber/tokenizer library for C?2Bonita Montero
14 Sep 24 i     ii    i    `- Re: Command line globber/tokenizer library for C?1Lawrence D'Oliveiro
13 Sep 24 i     ii    `* Re: Command line globber/tokenizer library for C?18Tim Rentsch
15 Sep 24 i     ii     `* Re: Command line globber/tokenizer library for C?17Michael S
16 Sep 24 i     ii      +* Re: Command line globber/tokenizer library for C?3Tim Rentsch
16 Sep 24 i     ii      i`* Re: Command line globber/tokenizer library for C?2Michael S
17 Sep 24 i     ii      i `- Re: Command line globber/tokenizer library for C?1Tim Rentsch
18 Sep 24 i     ii      `* Re: Command line globber/tokenizer library for C?13antispam
18 Sep 24 i     ii       +- Re: Command line globber/tokenizer library for C?1Tim Rentsch
18 Sep 24 i     ii       `* Re: Command line globber/tokenizer library for C?11Michael S
18 Sep 24 i     ii        +* Re: Command line globber/tokenizer library for C?5Bart
18 Sep 24 i     ii        i`* Re: Command line globber/tokenizer library for C?4Michael S
18 Sep 24 i     ii        i +* Re: Command line globber/tokenizer library for C?2Bart
18 Sep 24 i     ii        i i`- Re: Command line globber/tokenizer library for C?1David Brown
18 Sep 24 i     ii        i `- Re: Command line globber/tokenizer library for C?1Tim Rentsch
18 Sep 24 i     ii        +* Re: Command line globber/tokenizer library for C?3Tim Rentsch
18 Sep 24 i     ii        i`* Re: Command line globber/tokenizer library for C?2Michael S
18 Sep 24 i     ii        i `- Re: Command line globber/tokenizer library for C?1Tim Rentsch
18 Sep 24 i     ii        `* Re: Command line globber/tokenizer library for C?2Lawrence D'Oliveiro
18 Sep 24 i     ii         `- Re: Command line globber/tokenizer library for C?1Michael S
12 Sep 24 i     i`* Re: Command line globber/tokenizer library for C?14Bonita Montero
12 Sep 24 i     i `* Re: Command line globber/tokenizer library for C?13Janis Papanagnou
12 Sep 24 i     i  `* Re: Command line globber/tokenizer library for C?12Bonita Montero
12 Sep 24 i     i   +* Re: Command line globber/tokenizer library for C?2Janis Papanagnou
12 Sep 24 i     i   i`- Re: Command line globber/tokenizer library for C?1Bonita Montero
13 Sep 24 i     i   `* Re: Command line globber/tokenizer library for C?9Lawrence D'Oliveiro
13 Sep 24 i     i    `* Re: Command line globber/tokenizer library for C?8Bonita Montero
13 Sep 24 i     i     `* Re: Command line globber/tokenizer library for C?7Lawrence D'Oliveiro
13 Sep 24 i     i      `* Re: Command line globber/tokenizer library for C?6Michael S
14 Sep 24 i     i       `* Re: Command line globber/tokenizer library for C?5Lawrence D'Oliveiro
12 Sep 24 i     `- Re: Command line globber/tokenizer library for C?1Bonita Montero
12 Sep 24 `* Re: Command line globber/tokenizer library for C?4Bonita Montero

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal