|
From: <sr...@us...> - 2010-04-19 15:34:22
|
Revision: 26
http://golok.svn.sourceforge.net/golok/?rev=26&view=rev
Author: sralmai
Date: 2010-04-19 15:34:15 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
[BUGFIX (ID:2976528)]: undocumented coupling removed
Modified Paths:
--------------
trunk/Makefile
trunk/datatypes.scm
trunk/parser.scm
trunk/topo-datatypes.scm
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2010-03-25 17:52:38 UTC (rev 25)
+++ trunk/Makefile 2010-04-19 15:34:15 UTC (rev 26)
@@ -1,6 +1,9 @@
golok: lookup-table.scm datatypes.scm model-builder.scm search.scm golok.scm find-k.scm parser.scm topo-datatypes.scm
mzc --exe golok golok.scm
+test:
+ ./run-all.sh
+
render:
output/render.sh
Modified: trunk/datatypes.scm
===================================================================
--- trunk/datatypes.scm 2010-03-25 17:52:38 UTC (rev 25)
+++ trunk/datatypes.scm 2010-04-19 15:34:15 UTC (rev 26)
@@ -41,6 +41,7 @@
cons-to-vec
append-to-vec
cons-to-hash
+ symbol<?
state->process
@@ -212,3 +213,11 @@
((null? ls) -1)
((equal? item (car ls)) index)
(#t (item-index-rec item (add1 index) (cdr ls))))))
+
+
+;;
+;; wrapper for string<? on symbols
+;;
+(define (symbol<? x y)
+ (string<? (symbol->string x) (symbol->string y)))
+
Modified: trunk/parser.scm
===================================================================
--- trunk/parser.scm 2010-03-25 17:52:38 UTC (rev 25)
+++ trunk/parser.scm 2010-04-19 15:34:15 UTC (rev 26)
@@ -281,7 +281,10 @@
; first do some quick sanity checks
(if (zero? (length p_processes)) (raise-user-error 'PARSE "no processes defined!") (void))
(if (zero? (length p_add-rules)) (raise-user-error 'PARSE "no addition rules defined!") (void))
- (let* ([procs (map p_proc2proc p_processes)]
+ (let* ([procs (sort (map p_proc2proc p_processes)
+ (lambda (x y)
+ (string<? (symbol->string (process-name x))
+ (symbol->string (process-name y)))))]
[add-rules (map parse-rule p_add-rules)]
[the-topo (parse-topo p_transitions)]
[names (map process-name procs)]
@@ -554,7 +557,7 @@
(define (create-kernel filename p_links)
(let* ([links (map parse_link p_links)]
[counts (count-links links)])
- (make-topology filename counts links)))
+ (make-topology filename (sort counts (lambda (x y) (symbol<? (car x) (car y)))) links)))
;;
;; (list-of link?
Modified: trunk/topo-datatypes.scm
===================================================================
--- trunk/topo-datatypes.scm 2010-03-25 17:52:38 UTC (rev 25)
+++ trunk/topo-datatypes.scm 2010-04-19 15:34:15 UTC (rev 26)
@@ -208,7 +208,7 @@
; (list-of-links result-from-verify-and-build-offsets) -> listing of each process, process type, and input id
(define build-model
- (lambda (lol offset-table)
+ (lambda (lol offset-table)
(let* ([size (ot_size offset-table)]
[vect (make-vector size (list))]
[dummy (for-each (lambda (x) (add-link x vect offset-table)) lol)])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|