🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.funkcyjne
Article #912

Dlaczego to nie dziala?

#912
From: ppp
Date: Mon, 21 May 2007 22:06
31 lines
1727 bytes
program ma zliczać ile razy w zadanym pliku wystąpił dany wyraz.
problem w tym, że za bardzo nie chce działać...

let isspace ch = (ch =' ') || (ch ='\t') || (ch ='\n') || (ch
='\r') ;;


let input_string channel =
  let s = ref "" and ch = ref (input_char channel) in
    begin
      while isspace (!ch) do ch := input_char channel done;
      while not (isspace (!ch)) do
        s := !s^(String.make 1 !ch);
        ch := input_char channel
      done;
      !s
    end
;;


let zlicz (nazwa,wyraz) =
  let plik = open_in nazwa
  in
    begin
      let i = ref (1) in
        while true do
	  let odczyt = input_string plik in
          i=i+1;
        done;
    end
;;
Technical Details
Message-ID: <1179785216.063894.71460@36g2000prm.googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!36g2000prm.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!36g2000prm.googlegroups.com!not-for-mail
From: ppp <jimmie0@wp.pl>
Newsgroups: pl.comp.lang.funkcyjne
Subject: Dlaczego to nie dziala?
Date: 21 May 2007 15:06:56 -0700
Organization: http://groups.google.com
Lines: 32
Message-ID: <1179785216.063894.71460@36g2000prm.googlegroups.com>
NNTP-Posting-Host: 62.233.248.29
Mime-Version: 1.0
X-Trace: posting.google.com 1179785255 4758 127.0.0.1 (21 May 2007 22:07:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 21 May 2007 22:07:35 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: 36g2000prm.googlegroups.com; posting-host=62.233.248.29;   posting-account=p0V1JA0AAACAHetgoXwsMI9j_pfyLJYv
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit