File tree 2 files changed +10
-10
lines changed
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ data SymbolExpr =
433
433
Symbol Id String [Index ScalarData ]
434
434
| Apply EgisonValue [ScalarData ]
435
435
| Quote ScalarData
436
- | FunctionData (Maybe EgisonValue ) [EgisonValue ] [EgisonValue ] [Index ScalarData ] -- fnname argnames arg indices
436
+ | FunctionData (Maybe EgisonValue ) [EgisonValue ] [EgisonValue ] [Index ScalarData ] -- fnname argnames args indices
437
437
deriving (Eq )
438
438
439
439
instance Eq PolyExpr where
Original file line number Diff line number Diff line change 1
1
(define $texts {"abba" "abracadabra" "seesaw" "elk" "grrrrrr" "up" "a" "aaaaa.....bbbbb" "Rosetta Code is a programming chrestomathy site."})
2
2
3
- (define $shufflingQuality
3
+ (define $shufflingQuality
4
4
(lambda [$l1 $l2]
5
5
(sum (map2 (lambda [$x $y] (if (eq? x y) 1 0)) l1 l2))))
6
6
7
- (define $shuffle
8
- (lambda [$lst]
7
+ (define $shuffle
8
+ (lambda [$lst]
9
9
(match [lst (randomize lst)] [(list eq) (multiset eq)]
10
10
{[[(loop $i [1 $n]
11
- <cons $x_i ...> <nil>)
11
+ <cons $x_i ...> <nil>)
12
12
(loop $i [1 n]
13
- (dfs <cons (& (|* !,x_i ,x_i) $y_i) ...>) <nil>)] (map 1#y_%1 (between 1 n))]})))
13
+ (dfs <cons (& (|* !,x_i ,x_i) $y_i) ...>) <nil>)] (map 1#y_%1 (between 1 n))]})))
14
14
15
15
(define $main
16
16
(lambda [$args]
17
17
(each (compose show print)
18
- (map (lambda [$text]
19
- (let {[$new (shuffle text)]}
20
- (S.concat {(pack text) " " (pack new) " " (show (shufflingQuality text new))})))
21
- (map unpack texts)))))
18
+ (map (lambda [$text]
19
+ (let {[$new (shuffle text)]}
20
+ (S.concat {(pack text) " " (pack new) " " (show (shufflingQuality text new))})))
21
+ (map unpack texts)))))
22
22
You can’t perform that action at this time.
0 commit comments