{"action":"created","comment":{"url":"https://api.github.com/repos/scala/scala.github.com/pulls/comments/77813961","id":77813961,"diff_hunk":"@@ -0,0 +1,58 @@\n+---\n+layout: tutorial\n+title: Donja granica tipa\n+\n+disqus: true\n+\n+tutorial: scala-tour\n+num: 20\n+outof: 33\n+language: ba\n+---\n+\n+Dok [gornja granica tipa](upper-type-bounds.html) limitira tip na podtip nekog drugog tipa,\n+*donja granica tipa* limitira tip da bude nadtip nekog drugog tipa.\n+Izraz `T >: A` izražava tipski parametar `T` ili apstraktni tip `T` koji je nadtip tipa `A`.\n+\n+Kroz slj. primjer vidjećemo zašto je ovo korisno:\n+\n+    case class ListNode[T](h: T, t: ListNode[T]) {\n+      def head: T = h\n+      def tail: ListNode[T] = t\n+      def prepend(elem: T): ListNode[T] =\n+        ListNode(elem, this)\n+    }\n+\n+Gornji program implementira povezanu listu s operacijom nadovezivanja(na početak liste).\n+Nažalost, ovaj tip je invarijantan u tipskom parametru `T`, klase `ListNode`;\n+tj. `ListNode[String]` nije podtip `ListNode[Any]`.\n+Pomoću [anotacija varijanci](variances.html) možemo izraziti navedeno:\n+\n+    case class ListNode[+T](h: T, t: ListNode[T]) { ... }\n+\n+Nažalost, ovaj program se ne može kompajlirati, jer anotacija za kovarijancu je jedino moguća ako se varijabla tipa koristi na kovarijantnoj poziciji(u ovom slučaju kao povratni tip).\n+Pošto je varijabla tipa `T` tipski parametar metode `prepend`, ovo pravilo je prekršeno.\n+Pomoću *donje granice tipa*, možemo implementirati operaciju nadovezivanja gdje se `T` pojavljuje samo u kovarijantnoj poziciji.\n+\n+Ovo je odgovarajući kod:\n+\n+    case class ListNode[+T](h: T, t: ListNode[T]) {\n+      def head: T = h\n+      def tail: ListNode[T] = t\n+      def prepend[U >: T](elem: U): ListNode[U] =\n+        ListNode(elem, this)\n+    }\n+\n+_Napomena:_ nova `prepend` metoda ima manje restriktivan tip.\n+Ona dozvoljava, naprimjer, da se nadoveže objekt nadtipa na postojeću listu.","path":"ba/tutorials/tour/lower-type-bounds.md","position":47,"original_position":47,"commit_id":"8ca8faaeaf421aa6b3998a6d9b2c8bc11ddd9a01","original_commit_id":"8ca8faaeaf421aa6b3998a6d9b2c8bc11ddd9a01","user":{"login":"vjovanov","id":352820,"avatar_url":"https://avatars.githubusercontent.com/u/352820?v=3","gravatar_id":"","url":"https://api.github.com/users/vjovanov","html_url":"https://github.com/vjovanov","followers_url":"https://api.github.com/users/vjovanov/followers","following_url":"https://api.github.com/users/vjovanov/following{/other_user}","gists_url":"https://api.github.com/users/vjovanov/gists{/gist_id}","starred_url":"https://api.github.com/users/vjovanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vjovanov/subscriptions","organizations_url":"https://api.github.com/users/vjovanov/orgs","repos_url":"https://api.github.com/users/vjovanov/repos","events_url":"https://api.github.com/users/vjovanov/events{/privacy}","received_events_url":"https://api.github.com/users/vjovanov/received_events","type":"User","site_admin":false},"body":"Search and replace this, I will not comment any more. ","created_at":"2016-09-07T12:45:35Z","updated_at":"2016-09-07T12:45:35Z","html_url":"https://github.com/scala/scala.github.com/pull/564#discussion_r77813961","pull_request_url":"https://api.github.com/repos/scala/scala.github.com/pulls/564","_links":{"self":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/comments/77813961"},"html":{"href":"https://github.com/scala/scala.github.com/pull/564#discussion_r77813961"},"pull_request":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/564"}}},"pull_request":{"url":"https://api.github.com/repos/scala/scala.github.com/pulls/564","id":82988183,"html_url":"https://github.com/scala/scala.github.com/pull/564","diff_url":"https://github.com/scala/scala.github.com/pull/564.diff","patch_url":"https://github.com/scala/scala.github.com/pull/564.patch","issue_url":"https://api.github.com/repos/scala/scala.github.com/issues/564","number":564,"state":"open","locked":false,"title":"Added Bosnian translations for tour and cheatsheet","user":{"login":"sake92","id":12010694,"avatar_url":"https://avatars.githubusercontent.com/u/12010694?v=3","gravatar_id":"","url":"https://api.github.com/users/sake92","html_url":"https://github.com/sake92","followers_url":"https://api.github.com/users/sake92/followers","following_url":"https://api.github.com/users/sake92/following{/other_user}","gists_url":"https://api.github.com/users/sake92/gists{/gist_id}","starred_url":"https://api.github.com/users/sake92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sake92/subscriptions","organizations_url":"https://api.github.com/users/sake92/orgs","repos_url":"https://api.github.com/users/sake92/repos","events_url":"https://api.github.com/users/sake92/events{/privacy}","received_events_url":"https://api.github.com/users/sake92/received_events","type":"User","site_admin":false},"body":"Added Bosnian translations for following:\r\n- tutorials/tour\r\n- cheatsheet\r\n\r\nSince Croatian and Serbian are very similar languages to Bosnian, they will also benefit from this, I hope. :)","created_at":"2016-08-27T13:36:08Z","updated_at":"2016-09-07T12:45:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2611224a2ba9a709cb5bf1a8222427e4a6b1fa31","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scala/scala.github.com/pulls/564/commits","review_comments_url":"https://api.github.com/repos/scala/scala.github.com/pulls/564/comments","review_comment_url":"https://api.github.com/repos/scala/scala.github.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/scala.github.com/issues/564/comments","statuses_url":"https://api.github.com/repos/scala/scala.github.com/statuses/8ca8faaeaf421aa6b3998a6d9b2c8bc11ddd9a01","head":{"label":"sake92:ba-tour-cheatsheet","ref":"ba-tour-cheatsheet","sha":"8ca8faaeaf421aa6b3998a6d9b2c8bc11ddd9a01","user":{"login":"sake92","id":12010694,"avatar_url":"https://avatars.githubusercontent.com/u/12010694?v=3","gravatar_id":"","url":"https://api.github.com/users/sake92","html_url":"https://github.com/sake92","followers_url":"https://api.github.com/users/sake92/followers","following_url":"https://api.github.com/users/sake92/following{/other_user}","gists_url":"https://api.github.com/users/sake92/gists{/gist_id}","starred_url":"https://api.github.com/users/sake92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sake92/subscriptions","organizations_url":"https://api.github.com/users/sake92/orgs","repos_url":"https://api.github.com/users/sake92/repos","events_url":"https://api.github.com/users/sake92/events{/privacy}","received_events_url":"https://api.github.com/users/sake92/received_events","type":"User","site_admin":false},"repo":{"id":58576291,"name":"scala.github.com","full_name":"sake92/scala.github.com","owner":{"login":"sake92","id":12010694,"avatar_url":"https://avatars.githubusercontent.com/u/12010694?v=3","gravatar_id":"","url":"https://api.github.com/users/sake92","html_url":"https://github.com/sake92","followers_url":"https://api.github.com/users/sake92/followers","following_url":"https://api.github.com/users/sake92/following{/other_user}","gists_url":"https://api.github.com/users/sake92/gists{/gist_id}","starred_url":"https://api.github.com/users/sake92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sake92/subscriptions","organizations_url":"https://api.github.com/users/sake92/orgs","repos_url":"https://api.github.com/users/sake92/repos","events_url":"https://api.github.com/users/sake92/events{/privacy}","received_events_url":"https://api.github.com/users/sake92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sake92/scala.github.com","description":"The Scala Documentation website","fork":true,"url":"https://api.github.com/repos/sake92/scala.github.com","forks_url":"https://api.github.com/repos/sake92/scala.github.com/forks","keys_url":"https://api.github.com/repos/sake92/scala.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sake92/scala.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sake92/scala.github.com/teams","hooks_url":"https://api.github.com/repos/sake92/scala.github.com/hooks","issue_events_url":"https://api.github.com/repos/sake92/scala.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/sake92/scala.github.com/events","assignees_url":"https://api.github.com/repos/sake92/scala.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/sake92/scala.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/sake92/scala.github.com/tags","blobs_url":"https://api.github.com/repos/sake92/scala.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sake92/scala.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sake92/scala.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/sake92/scala.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sake92/scala.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/sake92/scala.github.com/languages","stargazers_url":"https://api.github.com/repos/sake92/scala.github.com/stargazers","contributors_url":"https://api.github.com/repos/sake92/scala.github.com/contributors","subscribers_url":"https://api.github.com/repos/sake92/scala.github.com/subscribers","subscription_url":"https://api.github.com/repos/sake92/scala.github.com/subscription","commits_url":"https://api.github.com/repos/sake92/scala.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/sake92/scala.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/sake92/scala.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/sake92/scala.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/sake92/scala.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/sake92/scala.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sake92/scala.github.com/merges","archive_url":"https://api.github.com/repos/sake92/scala.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sake92/scala.github.com/downloads","issues_url":"https://api.github.com/repos/sake92/scala.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/sake92/scala.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/sake92/scala.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/sake92/scala.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sake92/scala.github.com/labels{/name}","releases_url":"https://api.github.com/repos/sake92/scala.github.com/releases{/id}","deployments_url":"https://api.github.com/repos/sake92/scala.github.com/deployments","created_at":"2016-05-11T19:55:54Z","updated_at":"2016-05-11T19:55:57Z","pushed_at":"2016-08-27T13:31:19Z","git_url":"git://github.com/sake92/scala.github.com.git","ssh_url":"git@github.com:sake92/scala.github.com.git","clone_url":"https://github.com/sake92/scala.github.com.git","svn_url":"https://github.com/sake92/scala.github.com","homepage":"http://docs.scala-lang.org","size":4463,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala:master","ref":"master","sha":"80a75033a793dd77a212a57e5fe7e67b4a1b0a1b","user":{"login":"scala","id":57059,"avatar_url":"https://avatars.githubusercontent.com/u/57059?v=3","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"repo":{"id":2577071,"name":"scala.github.com","full_name":"scala/scala.github.com","owner":{"login":"scala","id":57059,"avatar_url":"https://avatars.githubusercontent.com/u/57059?v=3","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala/scala.github.com","description":"The Scala Documentation website","fork":false,"url":"https://api.github.com/repos/scala/scala.github.com","forks_url":"https://api.github.com/repos/scala/scala.github.com/forks","keys_url":"https://api.github.com/repos/scala/scala.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala/scala.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala/scala.github.com/teams","hooks_url":"https://api.github.com/repos/scala/scala.github.com/hooks","issue_events_url":"https://api.github.com/repos/scala/scala.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/scala/scala.github.com/events","assignees_url":"https://api.github.com/repos/scala/scala.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/scala/scala.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/scala/scala.github.com/tags","blobs_url":"https://api.github.com/repos/scala/scala.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala/scala.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala/scala.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala/scala.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala/scala.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/scala/scala.github.com/languages","stargazers_url":"https://api.github.com/repos/scala/scala.github.com/stargazers","contributors_url":"https://api.github.com/repos/scala/scala.github.com/contributors","subscribers_url":"https://api.github.com/repos/scala/scala.github.com/subscribers","subscription_url":"https://api.github.com/repos/scala/scala.github.com/subscription","commits_url":"https://api.github.com/repos/scala/scala.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala/scala.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala/scala.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala/scala.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala/scala.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/scala/scala.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala/scala.github.com/merges","archive_url":"https://api.github.com/repos/scala/scala.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala/scala.github.com/downloads","issues_url":"https://api.github.com/repos/scala/scala.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/scala/scala.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/scala/scala.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/scala/scala.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala/scala.github.com/labels{/name}","releases_url":"https://api.github.com/repos/scala/scala.github.com/releases{/id}","deployments_url":"https://api.github.com/repos/scala/scala.github.com/deployments","created_at":"2011-10-14T15:37:14Z","updated_at":"2016-09-06T08:09:37Z","pushed_at":"2016-09-04T16:25:09Z","git_url":"git://github.com/scala/scala.github.com.git","ssh_url":"git@github.com:scala/scala.github.com.git","clone_url":"https://github.com/scala/scala.github.com.git","svn_url":"https://github.com/scala/scala.github.com","homepage":"http://docs.scala-lang.org","size":5735,"stargazers_count":235,"watchers_count":235,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":265,"mirror_url":null,"open_issues_count":37,"forks":265,"open_issues":37,"watchers":235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/564"},"html":{"href":"https://github.com/scala/scala.github.com/pull/564"},"issue":{"href":"https://api.github.com/repos/scala/scala.github.com/issues/564"},"comments":{"href":"https://api.github.com/repos/scala/scala.github.com/issues/564/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/564/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/scala.github.com/pulls/564/commits"},"statuses":{"href":"https://api.github.com/repos/scala/scala.github.com/statuses/8ca8faaeaf421aa6b3998a6d9b2c8bc11ddd9a01"}}}}
{"actor":{"display_login":"vjovanov"}}