[EMAIL PROTECTED] writes:

> Quoting Bijan Soleymani <[EMAIL PROTECTED]>:
>
>> In perl you could do:
>> perl -e 'for(1..80){print "*";}print "\n";'
>
> Can you just explain how to use this for ? It seems far away the ones I know
> (C,C++,basic,Java,php,etc.)

That invocation happens to do the perlish thing of setting $_ to each
of 1, 2, 3, ..., 80 in turn.  Perl also supports the C-like for, but
that's not what you'd use in a one-liner.

For gratuitousness, in a completely different style:

(define (star-string n)
  (define (star-helper n s)
    (if (= n 0) s
      (star-helper (- n 1) (concat "*" s))))
  (star-helper n ""))

-- 
David Maze         [EMAIL PROTECTED]      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
        -- Abra Mitchell


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to