Skip to content

Commit

Permalink
Updated README and Fixed Configuration Key derpecated (#1)
Browse files Browse the repository at this point in the history
* Updated README and Fix configuration key.

* Added draft posts.
  • Loading branch information
loustler committed Feb 15, 2019
1 parent 89abbce commit be76c89
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
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-->

0 comments on commit be76c89

Please sign in to comment.