Skip to content

In som test: using relative pathname and a string as directory #42

@Yehouda

Description

@Yehouda

in som/examples/test.lisp, test:

  1. The argument filename default to a relative pathname, which works only if the current directory happens to be the right one. It needs to use asdf:system-relative-pathname to make sure it always gets it.

  2. The last argument to do-som-by-filename is a string, that ends being passed to make-pathname as the directory argumnet. But when make-pathname gets a string as a directoyr, it must be a top level directory, so it gets an error. It needs to pass a proper directory, for example
    (pathname-directory (asdf/system:system-relative-pathname "clml.som" "examples/")).

I change the definiton of test as below, and then it ran without a problem:

(defun test (&key (filename (asdf/system:system-relative-pathname
"clml.som" "examples/animal.dat")))
(declare (optimize (speed 3)))
(do-som-by-filename
filename
"hexa"
"gaussian"
24 ;; x size of map
16 ;; y size of map
123 ;; random seed
10000 ;; total length of study
5 ;; alpha x 100
2400 ;; radius x 100
10
(pathname-directory
(asdf/system:system-relative-pathname "clml.som" "examples/"))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions