JuliaDiff / JuliaDiff/BlueStyle

Guidelines for nested functions

Open
#58 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
519
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Just wanted to open up a chat about if functions should be nested, and if so where should they live?

function _bar(v::String)
  return string(v, v)
end

function foo()
  var = "Test"

  return _bar(var)
end

OR

function foo()
  function _bar(v::String)
    return string(v, v)
  end

  var = "Test"
  return _bar(var)
end

OR

function foo()
  var = "Test"

  function _bar(v::String)
    return string(v, v)
  end

  return _bar(var)
end

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Review the existing four-comment discussion and repository style-guide structure; done means reaching an agreed position and documenting the nested-function guideline in the appropriate place.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.