[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] using types
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-users] using types |
Date: |
21 Feb 2013 22:52:06 +0100 |
Somehow I can't verify that my type declarations are actually
effective.
So far I noticed that when I make usage-error wrt. types I
- within a single file that is -
get an error in tje compilation step.. Which is what I like.
Now that I've got a .types file for each module, I tried to
enforce this situation by violating the declared procedures
signature. But it did *not* give me the expected error.
Maybe I'm doing something wrong?
So far I'm relying on these lines from "manual/Types":
If library code is used with {{require-extension}} or {{(declare (unit
...))}} and a {{.types}} file of the same name exists in the
extension repository path, then it is automatically consulted. This
allows code using these libraries to take advantage of type-information
for library definitions.
I have a file foo.types, which declares
(: bar (fixnum) -> . *)
in foobar.scm I have
(declare
(unit foobar)
(uses foo)
...)
but the attempt to provoke an error by calling
(bar some-fixnum-which-is-from-working-code-anyway 27)
-- which clearly violates the given signature above giving
the additional parameter "27"
(while the signature in turn was verified to be correct in foo.types)
I did *not* result in any warning, let alone the stop-compile-on-error
I hoped to receive.
I'd like to add that prior to this experiment I went without
the (declare ... (uses foo) ...) having only an import statement
(import foo) in my foobar.scm - while this would be an analogous
use to the declare-variant it would be undocumented AFAI can see.
Now I dunno how I can make (sure) use of my type declarations
short of manually adding a "-types foo.types" entry for each an
every import in the scheme source to my Makefile.
Any help much apprecuated.
/Jörg
....
- [Chicken-users] using types,
Jörg F . Wittenberger <=