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

Add ~N sigil #740

Merged
merged 2 commits into from
Oct 20, 2016
Merged

Conversation

et
Copy link
Contributor

@et et commented Oct 19, 2016

@et
Copy link
Contributor Author

et commented Oct 19, 2016

I'm not totally sure how useful this may be (or if it's just added noise) but I generally reference ElixirSchool when there's a sigil I haven't seen before and noticed that this wasn't on the list (took some hard googling to find out what it was).

@@ -24,6 +24,7 @@ A list of available sigils include:
- `~s` Generates a string **with** escaping and interpolation
- `~W` Generates a word list **with no** escaping or interpolation
- `~w` Generates a word list **with** escaping and interpolation
- `~N` Generates a `NativeDateTime` struct
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it's Naive, not Native.

@@ -134,6 +135,16 @@ iex> ~W/i love #{'e'}lixir school/
["i", "love", "\#{'e'}lixir", "school"]
```

### NativeDateTime

A [NativeDateTime](http:https://elixir-lang.org/docs/stable/elixir/NaiveDateTime.html) can be useful for quickly creating a struct to represent a `DateTime` **without** a timezone.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native --> Naive


A [NativeDateTime](http:https://elixir-lang.org/docs/stable/elixir/NaiveDateTime.html) can be useful for quickly creating a struct to represent a `DateTime` **without** a timezone.

For the most part, we should avoid creating a `NativeDateTime` struct directly. However, it is very useful for pattern matching. For example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native --> Naive

@et et force-pushed the native-date-time-struct-sigil branch from dbb083f to 2ba6b11 Compare October 20, 2016 02:36
@et
Copy link
Contributor Author

et commented Oct 20, 2016

Great 👀 @ybur-yug @nscyclone! I've made the changes requested.

@nscyclone
Copy link
Member

LGTM.
Thanks, @et!

@ybur-yug ybur-yug merged commit 359299f into elixirschool:master Oct 20, 2016
@doomspork
Copy link
Member

@ybur-yug can you create an Issue for the translation of this?

@nscyclone nscyclone mentioned this pull request Oct 20, 2016
15 tasks
@et et deleted the native-date-time-struct-sigil branch October 20, 2016 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants