Skip to content

Passing maps as function argument #4

@alienfluid

Description

@alienfluid

Just started working through this book and it's been great so far!

A quick question on this example though --

  def to_light_seconds({:meters, meters} = val, precision: precision)  do
    (meters * 3.335638620368e-9) |> round_up
  end

What is val (in the functional argument) used for? When I run the tests, I get this warning:

warning: variable "val" is unused
  lib/physics/rocketry.ex:47

What is the point of val in this example? Also, is val bound to the map that is passed as argument?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions