Skip to content

Compile error #4

Description

@TrailingDots

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?

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