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

Use placeholders for local function names in function calls #27

Closed
angelikatyborska opened this issue Jul 31, 2021 · 0 comments
Closed
Assignees
Labels
x:action/improve Improve existing functionality/content x:knowledge/elementary Little Exercism knowledge required x:module/representer Work on Representers x:size/large Large amount of work x:status/claimed Someone is working on this issue x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)

Comments

@angelikatyborska
Copy link
Member

Input

defmodule HelloWorld do
  def hello(name) do
    "Hello, #{name}"
  end

  def hello() do
    hello("Alice")
  end
end

Desired output

A local function, when called, is referenced by the same placeholder name as when defined.

defmodule(PLACEHOLDER_1) do
  def(PLACEHOLDER_2(PLACEHOLDER_3)) do
    "Hello, #{PLACEHOLDER_3}"
  end
  def(PLACEHOLDER_2()) do
    PLACEHOLDER_2("Alice")
  end
end

Current output

Function names in function calls are not replaced by placeholders.

defmodule(PLACEHOLDER_1) do
  def(PLACEHOLDER_2(PLACEHOLDER_3)) do
    "Hello, #{PLACEHOLDER_3}"
  end
  def(PLACEHOLDER_2()) do
    hello("Alice")
  end
end

Please add extensive tests for various scenarios.

@angelikatyborska angelikatyborska added x:action/improve Improve existing functionality/content x:knowledge/elementary Little Exercism knowledge required x:module/representer Work on Representers x:size/large Large amount of work x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises) labels Jul 31, 2021
@angelikatyborska angelikatyborska self-assigned this Aug 4, 2021
@angelikatyborska angelikatyborska added the x:status/claimed Someone is working on this issue label Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/improve Improve existing functionality/content x:knowledge/elementary Little Exercism knowledge required x:module/representer Work on Representers x:size/large Large amount of work x:status/claimed Someone is working on this issue x:type/coding Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Projects
None yet
Development

No branches or pull requests

1 participant