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

Updated README and Fixed Configuration Key derpecated #1

Merged
merged 2 commits into from Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -10,9 +10,9 @@
3. Reference at another `index.html`, because it is very simple

# Local Server Start
`bundle exec jekyll serve`
If you want to run jekyll's server, run `jekyll serve`, if not, you want just build, run `jekyll build`

Open url is `localhost:4000` or `127.0.0.1:4000`
After you run to server, open these urls of `localhost:4000` or `127.0.0.1:4000` on your browser like Chrome, Safari, Firefox and etc.

# Setting for local
see [Setting up your GitHub Pages site locally with Jekyll](https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/)
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Expand Up @@ -19,7 +19,7 @@ kramdown:
input: GFM
highlighter: rouge

gems:
plugins:
- jekyll-paginate

paginate: 5
Expand Down
49 changes: 49 additions & 0 deletions _drafts/2019-01-02_scala-trait.md
@@ -0,0 +1,49 @@
---
layout: post
title: "Scala trait - 스칼라의 trait"
date: 2019-01-02 22:11:37 +0900
categories: [languages]
tags : [scala, functional programming]
---

Scala 에서는 `trait`이라는 신기한 녀석이 있다.

`trait`은 어떤 녀석이고 무엇을 하는 녀석일까

<!--more-->

Scala에서는 trait이라는 녀석이 있다.

Java를 알고 있는 사람이라면 `interface`와 유사하다고 볼 수도 있다.

`interface`와 유사하게 `trait`은 선언한 method를 하위 구현체에서 구현을 해주어야 한다.

물론 `interface`와 `default method`처럼 작성할 수도 있다.

다만 Java처럼 특정한 keyword 없이 구현할 수 있다.

가령 자바에서

{% highlight java %}
public interface Taste {
public boolean isSweet();

public default boolean isNotSweet() {
return !isSweet();
}
}
{% endhighlight %}

이와 같이 작성한다면

스칼라에서는

{% highlight java %}
trait Taste {
def isSweet(): Boolean

def isNotSweet(): Boolean = !isSweet()
}
{% endhighlight %}

와 같은 형태로 작성할 수 있다
15 changes: 15 additions & 0 deletions _drafts/2019-01-03_scala_mixin.md
@@ -0,0 +1,15 @@
---
layout: post
title: "Scala Mixin"
date: 2019-01-03 22:11:37 +0900
categories: [languages]
tags : [scala, functional programming]
---

Scala에서는 mix-in 이라는 개념이 있다.

`trait`을 사용할 경우에 사용이 가능한데

mix-in은 어떤 것이고 어떻게 사용할까?

<!--more-->