« Back to channel list

#elixir-lang - 02 May 2019

« Back 1 day Forward 1 day »
[00:06:18] kyrylo: has joined #elixir-lang
[00:11:08] Guest42: has joined #elixir-lang
[00:12:27] blahdodo: has joined #elixir-lang
[00:22:48] sparogy: has joined #elixir-lang
[00:24:42] ariedler: has joined #elixir-lang
[00:39:03] duaneb: has joined #elixir-lang
[00:44:26] ariedler: has joined #elixir-lang
[00:46:27] jnoon2: id love to understand or get rid of these "function has no local return" from vscode :) my function has a return so its very confusing. is it just because i haven't added a @spec?
[01:06:23] carldd: has joined #elixir-lang
[01:23:53] starbelly: jnoon2: Can you share what your function looks like?
[01:24:01] orbyt_: has joined #elixir-lang
[01:25:47] starbelly: Here's a good article on the subject: http://joedevivo.com/2015/06/14/no-local-return.html
[01:35:32] uranoss: has joined #elixir-lang
[01:39:28] uranoss: has joined #elixir-lang
[01:39:30] ariedler: has joined #elixir-lang
[01:41:28] micmus: has joined #elixir-lang
[01:41:45] jameshaydon: has joined #elixir-lang
[01:46:37] metalrain: has joined #elixir-lang
[01:46:38] benoitc: has joined #elixir-lang
[01:47:29] bcavileer: has joined #elixir-lang
[01:47:30] danmcclain_: has joined #elixir-lang
[01:47:30] marten: has joined #elixir-lang
[01:47:33] adamkittelson_: has joined #elixir-lang
[01:48:02] hansihe_: has joined #elixir-lang
[01:48:33] ckrailo: has joined #elixir-lang
[01:49:12] manveru: has joined #elixir-lang
[01:50:03] joedevivo: has joined #elixir-lang
[01:50:26] craigp: has joined #elixir-lang
[01:50:26] dch: has joined #elixir-lang
[01:50:45] ericmj: has joined #elixir-lang
[01:50:46] avdi: has joined #elixir-lang
[01:51:45] jeregrine: has joined #elixir-lang
[01:51:45] jhill: has joined #elixir-lang
[01:51:46] duaneb: has joined #elixir-lang
[01:52:00] msch: has joined #elixir-lang
[01:52:04] chazlever: has joined #elixir-lang
[01:52:07] marceldegraaf_: has joined #elixir-lang
[01:52:42] pmbauer: has joined #elixir-lang
[01:54:11] jeffweiss: has joined #elixir-lang
[01:54:39] whatyouhide: has joined #elixir-lang
[01:55:32] BBHoss: has joined #elixir-lang
[02:01:35] tomterl: has joined #elixir-lang
[02:09:01] craigp: has joined #elixir-lang
[02:11:17] craigp: has joined #elixir-lang
[02:17:39] pera: has joined #elixir-lang
[02:47:46] infowolfe: has joined #elixir-lang
[02:47:46] infowolfe: has joined #elixir-lang
[02:53:14] sparogy: has joined #elixir-lang
[03:15:47] wagnerst: has joined #elixir-lang
[03:21:48] carldd: has joined #elixir-lang
[03:23:50] orbyt_: has joined #elixir-lang
[03:24:21] jameshaydon: has joined #elixir-lang
[03:24:22] marten_: has joined #elixir-lang
[03:24:25] micmus: has joined #elixir-lang
[03:24:29] msch: has joined #elixir-lang
[03:24:30] adamkittelson_: has joined #elixir-lang
[03:24:39] ericmj_: has joined #elixir-lang
[03:24:44] marceldegraaf__: has joined #elixir-lang
[03:24:55] metalrain: has joined #elixir-lang
[03:25:01] jhill: has joined #elixir-lang
[04:09:25] Liru: has joined #elixir-lang
[04:17:56] mog: has joined #elixir-lang
[04:22:48] Liru: Does anyone here with experience with nimble_parsec know how to make a combinator that refers to a previous result? I'm essentially trying to do something to get an integer representation of length, then getting the appropriate number of characters for a string
[04:23:22] Liru: ie I'm looking into how to parse something like "6:elixir"
[04:27:12] gde33: has joined #elixir-lang
[04:48:36] jeffweiss: has joined #elixir-lang
[05:00:48] pera: has joined #elixir-lang
[05:03:14] orbyt_: has joined #elixir-lang
[05:03:18] wsieroci: has joined #elixir-lang
[05:09:53] voltone: has joined #elixir-lang
[05:18:17] infowolfe: has joined #elixir-lang
[05:18:17] infowolfe: has joined #elixir-lang
[05:20:26] kapil____: has joined #elixir-lang
[05:20:49] jeffweiss: has joined #elixir-lang
[05:22:49] sparogy: has joined #elixir-lang
[05:25:07] lauromoura_: has joined #elixir-lang
[05:26:26] serafeim: has joined #elixir-lang
[05:27:00] serafeim: good morning. I am trying to integrate ex_audit with my app and getting the following error: https://github.com/ZennerIoT/ex_audit/issues/14
[05:27:20] serafeim: I just opened it. any insights on how it can be fixed ?
[05:30:09] Nicd-: is that the whole stack trace?
[05:31:14] serafeim: Nicd-, i've updated it
[05:32:00] Nicd-: anyway the problem is probably in ex_audit, maybe with the stack trace you can find out where
[05:33:20] serafeim: well I guess that it passes a datetime somewhere without truncating the usecs
[05:35:49] serafeim: could I do it instead ? for example I've got the following in my changeset function: struct |> cast(params, [:patch, :entity_id, :entity_schema, :action, :recorded_at, :rollback])
[05:36:09] serafeim: could I do something to remove the usecs from the :recorded_at attribute ?
[05:36:52] Nicd-: well presumably you control what you are putting in that attribute
[05:40:13] serafeim: can't I change it with the changeset ?
[05:40:41] Nicd-: sure, but where is the data coming from?
[05:42:02] serafeim: from ex_audit
[05:50:34] gvaughn: has joined #elixir-lang
[05:59:00] serafeim: it's not working. probably the changeset function is not used at all :/
[06:12:34] serafeim: I was able to fix it by changing a line in the source code of ex_code
[06:25:36] voltone: has joined #elixir-lang
[06:33:35] wagnerst: has joined #elixir-lang
[06:37:50] netrino: has joined #elixir-lang
[06:40:26] serafeim_: has joined #elixir-lang
[06:44:28] serafeim__: has joined #elixir-lang
[06:55:57] markmm: has joined #elixir-lang
[06:58:00] marten: has joined #elixir-lang
[06:59:39] jhill: has joined #elixir-lang
[07:00:11] dch: has joined #elixir-lang
[07:01:14] benoitc: has joined #elixir-lang
[07:01:20] ckrailo: has joined #elixir-lang
[07:03:08] asabil: has joined #elixir-lang
[07:04:36] gvaughn: has joined #elixir-lang
[07:12:44] serafeim: has joined #elixir-lang
[07:14:12] micmus: has joined #elixir-lang
[07:14:51] wagnerst: has joined #elixir-lang
[07:19:15] PragTob: has joined #elixir-lang
[07:19:42] wagnerst: has joined #elixir-lang
[07:21:48] hypercore: has joined #elixir-lang
[07:22:29] hypercore: if i want to make my forms reactive using live view, do i need to replace new.html.eex with new.html.leex?
[07:26:24] jimmyrcom: has joined #elixir-lang
[07:27:43] jimmyrcom: has joined #elixir-lang
[07:53:10] mdbm: has joined #elixir-lang
[07:55:52] sparogy: has joined #elixir-lang
[08:05:11] jeffweiss: has joined #elixir-lang
[08:13:45] Guest42: has joined #elixir-lang
[08:18:41] gvaughn: has joined #elixir-lang
[08:19:53] netrino: has joined #elixir-lang
[08:20:51] jeffweiss: has joined #elixir-lang
[08:52:25] serafeim_: has joined #elixir-lang
[09:10:02] serafeim__: has joined #elixir-lang
[09:14:58] BitBot: has joined #elixir-lang
[09:18:56] serafeim_: has joined #elixir-lang
[09:19:21] hypercore: anyone around?
[09:22:48] kyrylo: has joined #elixir-lang
[09:26:48] hypercore: was hoping someone was here
[09:27:06] dysfun: definitely not
[09:27:08] dysfun: not you, not me
[09:28:09] dysfun: don't ask to ask questions, just ask
[09:28:24] dysfun: the 'try your luck' approach works better
[09:31:33] hypercore: ok, just having some trouble with live view, i'm using the "user" example with an added "birthday" field (:naive_datetime), and i want to perform a validate this field to allow only dates in the past. I've set the default value in my template as: <%= datetime_select, ..., value: if @changeset.data.birthday, do: @changeset.data.birthday, else: DateTime.utc_now %>
[09:31:59] hypercore: but every time i change one of the select inputs, it changes the date back to DateTime.utc_now
[09:33:16] hypercore: in my handle_event for "validate", the changeset which is sent back to the socket has the updated date, but on my page the date keeps resetting
[09:34:51] hypercore: am i accessing the updated changeset incorrectly? (by using @changeset.data)
[09:35:29] hypercore: oh yeah i am
[09:35:37] hypercore: should be using @change.changes apparently
[09:37:46] dysfun: tech support bear scores again
[09:40:44] greengriminal: has joined #elixir-lang
[10:01:39] gvaughn: has joined #elixir-lang
[10:13:25] duaneb: has joined #elixir-lang
[10:13:35] mdbm_: has joined #elixir-lang
[10:16:12] mdbm__: has joined #elixir-lang
[10:16:29] stiang_: has joined #elixir-lang
[10:16:46] gausby__: has joined #elixir-lang
[10:17:09] gausby-: has joined #elixir-lang
[10:17:12] paradoxx: has joined #elixir-lang
[10:17:54] LordPtolemy[m]1: has joined #elixir-lang
[10:18:57] fowlduck_: has joined #elixir-lang
[10:19:46] Bla[m]: has joined #elixir-lang
[10:19:46] Bla[m]: has joined #elixir-lang
[10:19:49] phantummmm: has joined #elixir-lang
[10:19:59] null__: has joined #elixir-lang
[10:20:07] nolan_d: has joined #elixir-lang
[10:20:12] celyr_: has joined #elixir-lang
[10:20:35] zkat: has joined #elixir-lang
[10:23:26] sparogy: has joined #elixir-lang
[10:25:56] hypercore: has Ecto.DateTime.cast been deprecated?
[10:26:30] hypercore: is there another way to convert %{"day" => "1", "month" => "1", "year" => "2019"} to a DateTime object?
[10:28:29] josevalim: hypercore: Ecto.Type.casts(:datetime, %{"day" => "1", "month" => "1", "year" => "2019"} )
[10:29:07] josevalim: also use Ecto.Changeset.get_field for the previous questio
[10:29:13] josevalim: it will look up in the proper places and default correctly
[10:30:29] hypercore: awesome, thanks jose
[10:30:33] voltone: has joined #elixir-lang
[10:35:22] serafeim_: i am trying this but I get an error :(
[10:35:23] serafeim_: iex(11)> Ecto.Type.cast(:datetime, %{"day" => "1", "month" => "1", "year" => "2019"} )
[10:35:23] serafeim_: ** (UndefinedFunctionError) function :datetime.cast/1 is undefined (module :datetime is not available)
[10:38:48] serafeim__: has joined #elixir-lang
[10:45:59] serafeim_: has joined #elixir-lang
[10:47:25] voltone: has joined #elixir-lang
[10:50:17] qqwy: has joined #elixir-lang
[10:50:34] hypercore: serafeim_: use :date if it's a Date value
[10:51:03] serafeim_: thanks hypercore
[10:51:35] serafeim_: it works with :date.
[10:51:50] qqwy: ACTION waves
[10:52:01] serafeim_: but this does not work: Ecto.Type.cast(:datetime, %{"day" => "1", "month" => "1", "year" => "2019", "hour" => 13, "minute" => 12} )
[10:52:07] qqwy: I have a design question. I want to take a shot at constructing a reusable 'GenPersistentServer' interface
[10:52:11] qqwy: It would be wonderful if people would just be able to swap the line 'use GenServer' for 'use GenPersistenServer', and it would simply use the existing `init/handle_cast/handle_call` definitions and wrap them with persisting logic.
[10:52:34] serafeim_: still gettin the same error (UndefinedFunctionError) function :datetime.cast/1 is undefined (module :datetime is not available)
[10:53:10] qqwy: Are there ways to do this? (Since GenServer is a behaviour and thus YourModule.handle_call/cast is called directly by it, we need a way to inject logic in-between what users write and what is called by GenServer)
[10:53:32] qqwy: The only way I've come up with so far seems to redefine 'def', which... is a bit much, maybe?
[10:58:54] hypercore: serafeim_: use :naive_datetime
[11:00:38] serafeim_: hypercore, excellent thank you !
[11:10:30] serafeim: has joined #elixir-lang
[11:11:47] duaneb: has joined #elixir-lang
[11:13:46] gvaughn: has joined #elixir-lang
[11:23:15] Guest42: has joined #elixir-lang
[11:27:13] Guest42: has joined #elixir-lang
[11:58:34] wsieroci: has joined #elixir-lang
[12:13:57] josevalim: qqwy: you have to explicitly wrap all of the callbacks
[12:14:04] josevalim: qqwy: see how GenStage is implemented for example
[12:16:39] asabil: has joined #elixir-lang
[12:31:25] user: has joined #elixir-lang
[12:32:22] DTZUZO: has joined #elixir-lang
[12:33:35] gvaughn: has joined #elixir-lang
[12:37:10] mdbm: has joined #elixir-lang
[12:38:15] Jetimon: has joined #elixir-lang
[12:43:57] kyrylo: has joined #elixir-lang
[12:52:34] wsieroci: has joined #elixir-lang
[12:53:48] sparogy: has joined #elixir-lang
[12:57:58] duaneb: has joined #elixir-lang
[12:58:14] mdbm_: has joined #elixir-lang
[13:03:54] shmink: has joined #elixir-lang
[13:05:09] shmink: Anyone know of a way that I can turn "+" into the the operator itself to sum 2 integers?
[13:06:24] shmink: I'm trying to do some polish reverse notation and I can really wrap my head around how I deal with that fact. The data will all be a string and then I can split it up, turn relevant strings to integers where necessary but the operator, how do I deal with that?
[13:09:42] shmink: oh, could I change it to an atom and then I could just match on it. Such as "+" to atom `:+`, right?
[13:18:58] tnez: has joined #elixir-lang
[13:19:30] ariedler: shmink: you could just return the function :P
[13:21:05] Nicd-: shmink: `&Kernel.+/2`
[13:21:44] netrino: has joined #elixir-lang
[13:21:46] Nicd-: for example: `foo = &Kernel.+/2; foo.(1, 2)`
[13:27:21] shmink: Is there a safe way to map through a list, if it can be turned into a integer, do that, otherwise change it to an atom?
[13:27:53] Nicd-: yes, but creating atoms from arbitrary data is always dangerous¨
[13:28:12] Nicd-: if you guard against overflowing the atom table, then just make your own map function with a case
[13:29:01] asabil: has joined #elixir-lang
[13:29:07] either|or: has joined #elixir-lang
[13:34:03] gvaughn: has joined #elixir-lang
[13:39:15] shmink: Is there a shorthand syntax for a try rescue statement such as `def foo, do: bar`?
[13:44:21] serafeim: what's the idiomatic way of convering "ABC" to ["A", "B", "C"] ? I did it with "ABC" | String.split("") ... is there a better way ?
[13:46:25] cjk101010: serafeim: maybe have a look at String.graphemes/1
[13:46:54] cjk101010: or String.codepoints/1, depending on what you really want :-)
[13:48:53] serafeim: cjk101010 they both work and produec the same result...
[13:50:00] cjk101010: have a look at the documentation. String.codepoints/1 differs from String.graphemes fundamentally, regarding unicode and normalization
[13:50:10] hypercore: is it possible to give multiple fields to add_error in a custom validation?
[13:50:22] serafeim: cjk101010 yes i'm looking at it right now thanks
[13:50:39] hypercore: e.g. if two fields are related and have the same error message, how can i show the same error message for both fields?
[13:51:08] cjk101010: hypercore: add the same error on both fields separately. You can't add an error for two fields at once.
[13:52:32] serafeim: cjk101010 what's strange to me is that this is true "Άά" |> String.graphemes == "Άά" |> String.codepoints ; should it be false ?
[13:54:29] drincruz: has joined #elixir-lang
[13:55:34] cjk101010: serafeim: depends. Unicode has two methods on creating a glyph: either combining multiple characters or using a codepoint for a specific character. E.g. your alpha thingie can be expressed as U+03AC or as U+03B1 + U+0301
[13:55:58] cjk101010: in the first case is String.graphemes() == String.codepoints(), in the second case it is not
[13:56:25] serafeim: cjk101010 ok it seems that for greek it uses the single character case
[13:56:36] cjk101010: it depends on your input string
[13:57:09] serafeim: so probably grapheme is the correct one to properly group accented digits
[13:57:30] cjk101010: sounds like it, yes
[13:58:16] mdbm_: has joined #elixir-lang
[14:00:15] jeffweiss: has joined #elixir-lang
[14:02:36] ariedler: has joined #elixir-lang
[14:08:26] gvaughn: has joined #elixir-lang
[14:17:10] Guest42: has joined #elixir-lang
[14:18:09] greengriminal: has joined #elixir-lang
[14:20:15] asabil: has joined #elixir-lang
[14:21:01] wsieroci: has joined #elixir-lang
[14:22:09] hypercore: has joined #elixir-lang
[14:24:31] ariedler: has joined #elixir-lang
[14:31:20] asabil: has joined #elixir-lang
[14:48:32] notzmv: has joined #elixir-lang
[14:53:03] arrakeen: Hello, I've been playing with elixir the past hour and it feels really good. I am stuck trying to figure out how to do partial application with pipes. (Maybe I need to finish the tutorial though)
[14:53:09] arrakeen: https://pastebin.com/SRNRWZ6X
[14:53:32] arrakeen: Maybe I am approching it wrong
[14:56:15] serafeim: in your example Scheduler.shuffle |> Enum.member("lol") should work
[14:56:29] serafeim: the 1st parameter is passed implicitly to the pipe
[14:57:08] serafeim: so if you have foo = [1,2,3] you can use Enum.member(foo, 1) or foo |> Enum.member(1)
[14:57:58] serafeim_: has joined #elixir-lang
[14:58:10] serafeim_: what you need to keep in mind is that the "object" of all functions should be passed as the 1st parameter and then just skip it
[14:58:44] serafeim_: the pipes are something like the thread-first (->) clojure macro
[14:59:18] arrakeen: Ok, I see. Makes sense
[14:59:52] ariedler: has joined #elixir-lang
[15:00:11] arrakeen: It does work. (I also made the mistake of using an array as an argument to member)
[15:01:17] serafeim__: has joined #elixir-lang
[15:04:17] danguita: has joined #elixir-lang
[15:10:41] aalmazan: has joined #elixir-lang
[15:16:13] kapil____: has joined #elixir-lang
[15:17:06] infowolfe: has joined #elixir-lang
[15:22:00] nineczar: has joined #elixir-lang
[15:24:54] infowolfe: has joined #elixir-lang
[15:24:54] infowolfe: has joined #elixir-lang
[15:30:25] icecreamcohen: has joined #elixir-lang
[15:32:06] icecreamcohen: has joined #elixir-lang
[15:33:59] Phylock: has joined #elixir-lang
[15:42:25] pera: has joined #elixir-lang
[16:01:15] mozzarella: has joined #elixir-lang
[16:05:49] laut: has joined #elixir-lang
[16:07:50] lexmag: has joined #elixir-lang
[16:36:34] mog: has joined #elixir-lang
[16:43:21] hypercore: has joined #elixir-lang
[16:51:36] wonko77: has joined #elixir-lang
[17:04:29] jnoon2: has joined #elixir-lang
[17:12:12] Sgeo_: has joined #elixir-lang
[17:22:47] qqwy: has joined #elixir-lang
[17:25:58] mahmudov: has joined #elixir-lang
[17:30:38] ariedler: has joined #elixir-lang
[17:34:16] squall: has joined #elixir-lang
[17:44:00] lauromoura_: has joined #elixir-lang
[17:44:18] icecreamcohen: has joined #elixir-lang
[18:04:16] gvaughn: has joined #elixir-lang
[18:18:10] Sgeo__: has joined #elixir-lang
[18:24:45] pera: has joined #elixir-lang
[18:32:15] Sgeo_: has joined #elixir-lang
[18:40:40] Blkt: has joined #elixir-lang
[18:44:40] Blkt: has joined #elixir-lang
[19:05:20] serafeim: has joined #elixir-lang
[19:05:24] hypercore: is it possible to get a <%= select f, :fieldname %> form a name other than :fieldname?
[19:06:06] Nicd-: have you tried `select f, :fieldname, name: :foo`?
[19:09:51] hypercore: Nicd-: i did, although im trying to embed a this select inside another group of forms, so this gives me "group1_embed" instead of "group1[embed]" if that makes sense
[19:10:38] hypercore: i.e. %{"group1_embed" => X, "group" => %{"a" => Y, "b" => Z}}
[19:14:40] styles: has joined #elixir-lang
[19:15:38] styles: Hey, I'm looking for a good resource to learn the elixir syntax / primitives. I've read some of the docs on elixir-lang but they talk more about comparing against Erlang. I have no experience with either and am seeing funky terms like atom.
[19:16:01] styles: bah nvm ignore me: https://elixir-lang.org/getting-started/basic-types.html
[19:16:26] Nicd-: glad we could help
[19:19:29] styles: I don't quite understand the point in atoms. If I have :user (user is the variable name and the string is of value "user")?
[19:19:44] styles: Why use an atom over say a variable?
[19:20:26] Nicd-: it is not a string
[19:20:34] Nicd-: the value of :user is :user
[19:21:27] Nicd-: think of a usual map %{"user_id" => 5}, and think what waste it is to use memory to store a string "user_id" only to use it as a key (its string properties are not used at all)
[19:22:07] styles: ah that makes sense
[19:22:21] Nicd-: technically atoms map to integers transparently. so you can write %{:user => 5} instead and it will not use memory needlessly
[19:22:40] Nicd-: :user_id* :)
[19:22:58] styles: how does an atom know where to get the data froM?
[19:23:14] Nicd-: get what data?
[19:23:57] styles: If I reference some boilerplate Phoenix code, is that ok?
[19:24:18] Nicd-: use gist.github.com or other pastebin for pastes
[19:24:44] styles: https://gist.github.com/clanstyles/45f6ac9c6bd9b6494b20d2337d6059d1 - so take this for example, they're using atoms all over.
[19:26:22] Nicd-: what there specifically?
[19:26:52] styles: I guess all the instances of the atoms. I understand the use HelloWeb, but what are fetch_session for example
[19:27:11] Nicd-: they are names of plugs builtin to Phoenix
[19:27:22] styles: There are other functions like Conn.fetch_session
[19:27:47] styles: So is that just referencing the function somewhere from another module lower?
[19:27:58] Nicd-: I believe the :fetch_session plug uses the function Plug.Conn.fetch_session
[19:28:03] tristanm_: does elixir just use `--name` and figures out from the passed name if it should use a longname or shortname when enabling net_kernel?
[19:28:49] qqwy: has joined #elixir-lang
[19:28:51] styles: How does it know what module to look at (Plug.Conn)
[19:28:57] Nicd-: styles: those plug calls are macros that are compiled into some regular Elixir code and that code does something with the atoms. the atoms themselves are not magical. the macros are, though
[19:29:10] Nicd-: it does not use Plug.Conn directly
[19:30:33] Nicd-: oh it actually does
[19:30:37] Nicd-: this is the problem with macros :P
[19:30:57] Nicd-: from the docs: https://www.irccloud.com/pastebin/o38ZHzhA/
[19:31:14] Sgeo__: has joined #elixir-lang
[19:31:31] Nicd-: the router macros compile this into the code: `import Plug.Conn`
[19:31:33] Nicd-: among others
[19:31:40] Nicd-: so that's how it knows where the function is from
[19:31:47] styles: I think I understand. I'll keep reading, thanks
[19:31:50] styles: The atoms are just throwing me off lol
[19:31:59] Nicd-: you might want to start somewhere else than Phoenix source
[19:32:12] Nicd-: since Phoenix has a lot of macros that are difficult to find out how they work
[19:32:30] orbyt_: has joined #elixir-lang
[19:32:33] chrismccord: when you pass an atom to a plug, you are telling plug to call that local function
[19:33:03] chrismccord: the router imports plug conn functions, so you can plug them as atoms
[19:33:24] chrismccord: you coudl also `def foo(conn, _), do: send_resp(...)` and `plug :foo` in your router
[19:33:27] chrismccord: same difference
[19:33:41] chrismccord: the atom vs Module form of plug is for calling local functions
[19:39:36] serafeim: i have a foo.name somewhere. foo *may* be nill. if foo is nill I want foo.name to return nil; instead it throws an exception
[19:40:13] serafeim: is there an easy way to resolve this? something like kotlin's elvis operator? I know i can use an if but I'm asking if there's something quicker
[19:43:31] dimitarvp: has joined #elixir-lang
[19:46:48] serafeim: notice that foo is an ecto schema
[19:50:06] thomasross: has joined #elixir-lang
[19:54:47] also_uplime: has joined #elixir-lang
[20:18:59] serafeim: has joined #elixir-lang
[20:20:00] serafeim: well i ended up using an if one liner... i don't like the syntax though :/
[20:28:22] icecreamcohen: has joined #elixir-lang
[20:35:59] asabil: has joined #elixir-lang
[20:48:44] NightMonkey: has joined #elixir-lang
[21:03:40] sparogy: has joined #elixir-lang
[21:05:17] lexmag: has joined #elixir-lang
[21:06:25] lexmag_: has joined #elixir-lang
[21:11:59] greengriminal: has joined #elixir-lang
[21:30:14] ur5us: has joined #elixir-lang
[21:36:02] icecreamcohen: has joined #elixir-lang
[21:47:38] __charly__: has joined #elixir-lang
[21:57:25] markmm: has joined #elixir-lang
[22:03:02] sparogy: has joined #elixir-lang
[22:08:06] ariedler: has joined #elixir-lang
[22:18:23] ariedler: has joined #elixir-lang
[22:24:13] ariedler: has joined #elixir-lang
[22:24:57] __charly__: has joined #elixir-lang
[22:26:03] icecreamcohen: has joined #elixir-lang
[22:32:40] alex88: has joined #elixir-lang
[22:35:39] BryanWB: has joined #elixir-lang
[22:41:21] qqwy: has joined #elixir-lang
[22:43:03] Guest42: has joined #elixir-lang
[22:45:30] qqwy: josevalim: Thank you. I only now see the answer you gave this afternoon :-)
[22:46:52] qqwy: I really like how you solved the problem in GenStage; I'll use it as inspiration for the code :-)
[23:14:55] notzmv: has joined #elixir-lang
[23:29:31] icecreamcohen: has joined #elixir-lang
[23:44:29] kyrylo: has joined #elixir-lang
[23:46:08] craigp: has joined #elixir-lang
[23:57:18] jeffro_: has joined #elixir-lang