C Syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cody

    Re: [OT] Re: C Syntax

    > Well, I had to place more IMO's, but check this:[color=blue]
    >
    > foo = lambda x, y: [str (i+j) for (i,j) in zip(x,y)]
    >
    > Well, it's not very clear, but how many lines of code in C
    > would be required to reproduce it? Types of x and y can be
    > either lists of lists, lists of strings, lists of numbers
    > or strings. And it maybe used for all that stuff.
    >
    > I don't understand, how several dozens lines of code can be
    > better than ONE line of code in non-esoteric language.[/color]


    Now one question arises: What exactly does this piece of code do?

    --
    cody

    [Freeware, Games and Humor]
    www.deutronium.de.vu || www.deutronium.tk


    Comment

    • Keith Thompson

      Re: [OT] Re: C Syntax

      Dan.Pop@cern.ch (Dan Pop) writes:
      [...[color=blue]
      > 2. Even if you don't, some text processing utilities may do it behind your
      > back. A typical example is vi, which "optimises" the storage of the
      > saved text by replacing multiple spaces by HTs according to the ts
      > variable setting. Since I have found no portable way of disabling this
      > feature, I'm setting ts to 100 in my .exrc.[/color]

      I'm not quite willing to do that, but I do have the following in my
      $HOME/.exrc:

      map ]^V^I :%!expand^M

      where the carets denote the obvious cotro characters.

      As I enter code, vi (I use nvi) insists on changing each 8 columns of
      indentation to a tab, but before saving the file I can hit a
      right-bracket followed by a tab and expand everything to spaces
      (unless I'm writing a Makefile, of course).

      --
      Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
      San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
      We must do something. This is something. Therefore, we must do this.

      Comment

      • I. Appel

        Re: [OT] Re: C Syntax

        "Mike" <noone@hotmail. com> wrote in message
        news:#yg7N9XSEH A.3476@tk2msftn gp13.phx.gbl...[color=blue][color=green][color=darkred]
        > > > >foo = lambda x, y: [str (i+j) for (i,j) in zip(x,y)]
        > > > >
        > > > >I don't understand, how several dozens lines of code can be
        > > > >better than ONE line of code in non-esoteric language.
        > > >
        > > > As you said, it's not very clear ;-) Actually, you'll have to define
        > > > "better" before you're qualified to offer an opinion.[/color]
        > >
        > > What is the reason to have syntax that is clearer-per-line, if it
        > > requires to write several times more lines of code?[/color]
        >
        > The functional versional would be compact and neat, but almost certainly
        > slower to exectue; the imperative version would be bigger, uglier, but[/color]
        most[color=blue]
        > probably faster. No one can claim that one is better than another, as it
        > completely depends on what you are trying to achieve.[/color]

        I agree with you, but the discussion is about _clear_ syntaxes.

        Ivan.


        Comment

        Working...