Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error #4

Open
TrailingDots opened this issue Sep 17, 2018 · 0 comments
Open

Compile error #4

TrailingDots opened this issue Sep 17, 2018 · 0 comments

Comments

@TrailingDots
Copy link

I added the routines on the README page to the exnn code.

Now I have:

exnn/lib
exnn/lib/exnn        # <- exnn base code
exnn/lib/myapp     # <- Routines from README code

I run as:

mix test test/examples/xor_test.exs
    ...
== Compilation error in file lib/my_app/fitness.ex ==
** (ArgumentError) struct fields definition must be list, got: %{inner_temp: 0.0, outer_temp: 40.0}
    (elixir) lib/kernel/utils.ex:73: Kernel.Utils.defstruct/2
    lib/my_app/fitness.ex:2: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

Struct fields are not a list. Is this a poor compiler error message? Does the compiler
have a problem?

The first few lines of lib/my_app/fitness.ex:

defmodule MyApp.Fitness do
  use EXNN.Fitness, state: %{inner_temp: 0.0, outer_temp: 40.0}

My configuration:


iex
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.6.6) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 
^c^c

erl
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.3  (abort with ^G)
1> 

I'm assuming this is a version skew problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant