[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simpe Gwydion question
On Friday, 12, 2002, at 12:45AM, Waldek Hebisch <hebisch@math.uni.wroc.pl> wrote:
>With format-out my gwydion-dylan-2.3.8 prints:
> Error: Undefined variable: format-out
Try:
make-dylan-app test .
make
./test
This should compile and run OK. If not, there's a problem with the GD installation.
Now look at test-exports.dylan. The library imports io and the module imports format-out. main() then calls format-out. This works under my 2.3.8, and prints floats as described when I add them to the format-out call.
> Error: Undefined variable: float-to-string
If the library and the module both import common-dylan then float-to-string works fine .
>: for (i from 0 below dvec.size)
Put a type constraint on i to improve performance. Probably:
for( i :: <integer> from 0 below dvec.size)
>: // i wanted to fill this with random numbers, but i couldn't find
>: // random() in common-extensions.
Use the random library and module. See:
http://www.gwydiondylan.org/gdref/gdlibs/libs-random-random.html
>: dvec[i] := i * 1.64;
Note the implicit type conversion. I don't know what to do about this. :-)
Can we populate a vector with values from a function? This would be quicker than making then populating. Or some sort of applying or mapping function.
>: for (i from 0 below dvec.size)
Again, a type constraint will improve performance here.
>Still, the program (simple heapsort benchmark)
>works as slow as previously -- many times slower then C, 15 times slower
>then CMU Common Lisp (generated C code still calls what looks like generic
>methods).
Please can you post the code so we can have a look. Fast Dylan is different from fast C (and subtly different from fast Lisp).
Thanks.
- Rob.