Sha256: ce95b56dc572879893a23beaa75edfa86acfab122fbdcfb56f505baf00195836

Contents?: true

Size: 492 Bytes

Versions: 396

Compression:

Stored size: 492 Bytes

Contents

(defmodule parallel-letter-frequency
  (export (dict 1)))

(defun dict (strings)
  (let ((pid (spawn #'loop/0)))
    (lists:foreach (lambda (string) (! pid `#(string ,string))) strings)
    (! pid `#(done ,(self))))
  (receive (freqs freqs)))

(defun loop () (loop (dict:new)))

(defun loop (freqs)
  (receive
    (`#(string ,string) (loop (lists:foldl #'frequency/2 freqs string)))
    (`#(done   ,from)   (! from freqs))))

(defun frequency (char freqs) (dict:update_counter char 1 freqs))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.179 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.178 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.177 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.176 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.175 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.174 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.173 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.172 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.171 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.170 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.169 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.167 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.166 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.165 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.164 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.163 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.162 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.161 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.160 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe