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.159 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.158 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.157 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.156 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.155 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.154 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.153 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.152 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.151 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.150 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.149 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.148 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.147 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.146 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.145 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.144 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.143 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.142 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.141 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe
trackler-2.2.1.140 tracks/lfe/exercises/parallel-letter-frequency/src/example.lfe