{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/comments/46722481","id":46722481,"diff_hunk":"@@ -51,29 +51,60 @@ possible to call a puppet function with a lambda, and possibly also type a param\n \n Function Definition - Scope & Autoloading\n ---\n-Puppet Functions are autoloaded from modules. They are located under <module-root>/functions.\n-The filename must match the simple (non namespaced name part) of the function. Thus, a function 'min' in module 'testmodule' is placed like this:\n+\n+#### Autoloading\n+\n+Puppet Functions are autoloaded from modules and the environment when located under <module-root>/functions or <environment-root>/functions respectively.\n+\n+The filename must match the simple (non namespaced name part) of the function. Thus, a function 'min' in module 'testmodule' is located like this:\n \n     testmodule\n       |- functions\n          | min.pp\n-         \n-The functions defined this way in modules must be name-spaced. Thus the contents of this `min.pp` is:\n+\n+With the following contents in `min.pp` (note use of full namespace):\n \n     function testmodule::min($a, $b) {\n       # ...\n     }\n \n-It is allowed to defined Puppet Functions in the environment's logic (i.e. `site.pp`, or in the manifests loaded from the manifests directory). It is also allowed to defined functions directly\n-on the command line when running puppet apply.\n+And in an environment like this:\n+\n+    production\n+      |- functions\n+         | min.pp\n+         \n+With the following contents in `min.pp` (note use of namespace 'environment'):\n+\n+    function environment::min($a, $b) {\n+      # ...\n+    }\n \n Rules:\n \n-* autoloaded functions in modules must have qualified names\n-* functions that are defined in modules, but that are not autoloaded (loaded as part of something   \n-  else) should also be defined in the module's namespace (it should be an error if an attempt is \n-  made to name it differently).\n-* functions defined in the environment may have any name (global or namespaced)\n-* A function loaded in the environment shadows functions from modules, but not system functions\n+* Files containing an auto loaded function may only contain a single function.","path":"language/puppet-functions.md","position":47,"original_position":47,"commit_id":"38a1929078a6119c01ee199e22107797baf0a4b5","original_commit_id":"38a1929078a6119c01ee199e22107797baf0a4b5","user":{"login":"nfagerlund","id":484309,"avatar_url":"https://avatars.githubusercontent.com/u/484309?v=3","gravatar_id":"","url":"https://api.github.com/users/nfagerlund","html_url":"https://github.com/nfagerlund","followers_url":"https://api.github.com/users/nfagerlund/followers","following_url":"https://api.github.com/users/nfagerlund/following{/other_user}","gists_url":"https://api.github.com/users/nfagerlund/gists{/gist_id}","starred_url":"https://api.github.com/users/nfagerlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfagerlund/subscriptions","organizations_url":"https://api.github.com/users/nfagerlund/orgs","repos_url":"https://api.github.com/users/nfagerlund/repos","events_url":"https://api.github.com/users/nfagerlund/events{/privacy}","received_events_url":"https://api.github.com/users/nfagerlund/received_events","type":"User","site_admin":false},"body":"Or else what?","created_at":"2015-12-04T19:35:29Z","updated_at":"2015-12-04T19:35:29Z","html_url":"https://github.com/puppetlabs/puppet-specifications/pull/59#discussion_r46722481","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/comments/46722481"},"html":{"href":"https://github.com/puppetlabs/puppet-specifications/pull/59#discussion_r46722481"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59","id":52661606,"html_url":"https://github.com/puppetlabs/puppet-specifications/pull/59","diff_url":"https://github.com/puppetlabs/puppet-specifications/pull/59.diff","patch_url":"https://github.com/puppetlabs/puppet-specifications/pull/59.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/59","number":59,"state":"open","locked":false,"title":"(PUP-5561) Clarify rules for autoloading puppet functions","user":{"login":"hlindberg","id":563066,"avatar_url":"https://avatars.githubusercontent.com/u/563066?v=3","gravatar_id":"","url":"https://api.github.com/users/hlindberg","html_url":"https://github.com/hlindberg","followers_url":"https://api.github.com/users/hlindberg/followers","following_url":"https://api.github.com/users/hlindberg/following{/other_user}","gists_url":"https://api.github.com/users/hlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlindberg/subscriptions","organizations_url":"https://api.github.com/users/hlindberg/orgs","repos_url":"https://api.github.com/users/hlindberg/repos","events_url":"https://api.github.com/users/hlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/hlindberg/received_events","type":"User","site_admin":false},"body":"This adds language to the puppet-functions.md that clarifies the rules for naming puppet functions and how autoloading and ad-hoc manifest defined functions work.","created_at":"2015-12-04T12:07:02Z","updated_at":"2015-12-04T19:35:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b66b158178ef87bd8345fe6e71f1b276c37145c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/59/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/statuses/38a1929078a6119c01ee199e22107797baf0a4b5","head":{"label":"hlindberg:master","ref":"master","sha":"38a1929078a6119c01ee199e22107797baf0a4b5","user":{"login":"hlindberg","id":563066,"avatar_url":"https://avatars.githubusercontent.com/u/563066?v=3","gravatar_id":"","url":"https://api.github.com/users/hlindberg","html_url":"https://github.com/hlindberg","followers_url":"https://api.github.com/users/hlindberg/followers","following_url":"https://api.github.com/users/hlindberg/following{/other_user}","gists_url":"https://api.github.com/users/hlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlindberg/subscriptions","organizations_url":"https://api.github.com/users/hlindberg/orgs","repos_url":"https://api.github.com/users/hlindberg/repos","events_url":"https://api.github.com/users/hlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/hlindberg/received_events","type":"User","site_admin":false},"repo":{"id":21333560,"name":"puppet-specifications","full_name":"hlindberg/puppet-specifications","owner":{"login":"hlindberg","id":563066,"avatar_url":"https://avatars.githubusercontent.com/u/563066?v=3","gravatar_id":"","url":"https://api.github.com/users/hlindberg","html_url":"https://github.com/hlindberg","followers_url":"https://api.github.com/users/hlindberg/followers","following_url":"https://api.github.com/users/hlindberg/following{/other_user}","gists_url":"https://api.github.com/users/hlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlindberg/subscriptions","organizations_url":"https://api.github.com/users/hlindberg/orgs","repos_url":"https://api.github.com/users/hlindberg/repos","events_url":"https://api.github.com/users/hlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/hlindberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hlindberg/puppet-specifications","description":"Specification of the Puppet Language, Catalog, Extension points","fork":true,"url":"https://api.github.com/repos/hlindberg/puppet-specifications","forks_url":"https://api.github.com/repos/hlindberg/puppet-specifications/forks","keys_url":"https://api.github.com/repos/hlindberg/puppet-specifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hlindberg/puppet-specifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hlindberg/puppet-specifications/teams","hooks_url":"https://api.github.com/repos/hlindberg/puppet-specifications/hooks","issue_events_url":"https://api.github.com/repos/hlindberg/puppet-specifications/issues/events{/number}","events_url":"https://api.github.com/repos/hlindberg/puppet-specifications/events","assignees_url":"https://api.github.com/repos/hlindberg/puppet-specifications/assignees{/user}","branches_url":"https://api.github.com/repos/hlindberg/puppet-specifications/branches{/branch}","tags_url":"https://api.github.com/repos/hlindberg/puppet-specifications/tags","blobs_url":"https://api.github.com/repos/hlindberg/puppet-specifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hlindberg/puppet-specifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hlindberg/puppet-specifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/hlindberg/puppet-specifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hlindberg/puppet-specifications/statuses/{sha}","languages_url":"https://api.github.com/repos/hlindberg/puppet-specifications/languages","stargazers_url":"https://api.github.com/repos/hlindberg/puppet-specifications/stargazers","contributors_url":"https://api.github.com/repos/hlindberg/puppet-specifications/contributors","subscribers_url":"https://api.github.com/repos/hlindberg/puppet-specifications/subscribers","subscription_url":"https://api.github.com/repos/hlindberg/puppet-specifications/subscription","commits_url":"https://api.github.com/repos/hlindberg/puppet-specifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/hlindberg/puppet-specifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/hlindberg/puppet-specifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/hlindberg/puppet-specifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/hlindberg/puppet-specifications/contents/{+path}","compare_url":"https://api.github.com/repos/hlindberg/puppet-specifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hlindberg/puppet-specifications/merges","archive_url":"https://api.github.com/repos/hlindberg/puppet-specifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hlindberg/puppet-specifications/downloads","issues_url":"https://api.github.com/repos/hlindberg/puppet-specifications/issues{/number}","pulls_url":"https://api.github.com/repos/hlindberg/puppet-specifications/pulls{/number}","milestones_url":"https://api.github.com/repos/hlindberg/puppet-specifications/milestones{/number}","notifications_url":"https://api.github.com/repos/hlindberg/puppet-specifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hlindberg/puppet-specifications/labels{/name}","releases_url":"https://api.github.com/repos/hlindberg/puppet-specifications/releases{/id}","created_at":"2014-06-29T22:25:42Z","updated_at":"2015-10-06T00:48:34Z","pushed_at":"2015-12-04T12:04:54Z","git_url":"git://github.com/hlindberg/puppet-specifications.git","ssh_url":"git@github.com:hlindberg/puppet-specifications.git","clone_url":"https://github.com/hlindberg/puppet-specifications.git","svn_url":"https://github.com/hlindberg/puppet-specifications","homepage":null,"size":387,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"c795ebe1f012e2db9d0ec11abb5cbfa8d6cc1aad","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":19628858,"name":"puppet-specifications","full_name":"puppetlabs/puppet-specifications","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet-specifications","description":"Specification of the Puppet Language, Catalog, Extension points","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet-specifications","forks_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet-specifications/releases{/id}","created_at":"2014-05-09T23:38:54Z","updated_at":"2015-11-30T10:03:46Z","pushed_at":"2015-12-04T12:07:03Z","git_url":"git://github.com/puppetlabs/puppet-specifications.git","ssh_url":"git@github.com:puppetlabs/puppet-specifications.git","clone_url":"https://github.com/puppetlabs/puppet-specifications.git","svn_url":"https://github.com/puppetlabs/puppet-specifications","homepage":null,"size":949,"stargazers_count":59,"watchers_count":59,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":2,"forks":34,"open_issues":2,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59"},"html":{"href":"https://github.com/puppetlabs/puppet-specifications/pull/59"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/59"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet-specifications/statuses/38a1929078a6119c01ee199e22107797baf0a4b5"}}}}