<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="29651" data-post-id="29651">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="11" data-topic="4509" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>How would it be different then just making a struct field by an anonymous function, just saving the <code>.</code> part of the invocation to become <code>blah.vweep(42)</code> instead of <code>blah.vweep.(42)</code> or so?</p>
</blockquote>
</aside>
<p>It would be <code>Blah.vweep(yourbla)</code>.</p>
<p>Or, to give a clearer example:</p>
<p>In the small programming language I am building, the current runtime state is represented as a <code>%Jux.State{}</code> struct. It used to have a field called <code>stack</code>, but at some point it turned out that it required to have a list of stacks, with most of the operations only accessing the first. But now I already wrote <code>state.stack</code> everywhere, and had to painstakingly replace it (What did not help, was that not all my state variables were called <code>state</code>, and that <code>stack</code> was also used as name for some other things elsewhere).</p>
<p>I changed it to <code>Jux.State.stack(state)</code>.</p>
<p>In the future, I’ll probably write it this way for all but the most trivial structs from the get-go, because this is more clear and allows you to change the inner implementation later on, as the external world is not tightly-coupled with your struct’s, well, structure.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29651" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-29651" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29651"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="29652" data-post-id="29652">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="12" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>In the small programming language I am building, the current runtime state is represented as a %Jux.State{} struct. It used to have a field called stack, but at some point it turned out that it required to have a list of stacks, with most of the operations only accessing the first. But now I already wrote state.stack everywhere, and had to painstakingly replace it (What did not help, was that not all my state variables were called state, and that stack was also used as name for some other things elsewhere).</p>
</blockquote>
</aside>
<p>Wouldn’t static typing be nice there to catch all occurrences that you need to replace?  ^.^</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29652" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-29652" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29652"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="29671" data-post-id="29671">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mgwidmann" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mgwidmann/120/7249_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mgwidmann
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="13" data-topic="4509" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>Wouldn’t static typing be nice there to catch all occurrences that you need to replace?  ^.^</p>
</blockquote>
</aside>
<p>No one wants to give up the flexibility of dynamic typing. With that said, if somehow dialyzer could be incorporated into the Elixir compiler to provide a static type analysis I think that’d be the holy grail of all this, this discussion would be over.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29671" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-29671" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29671"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="29686" data-post-id="29686">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>One thing that static typing nor Dialyzer would fix, is what happens when you write some code, publish it as a library, and then people start matching on your struct’s structure.</p>
<p>Because of backwards-compatibility, the structure of your struct is now ‘frozen’. The old fields will need to be kept in there because some other code might depend on it.</p>
<p>In e.g. Haskell, when you define a data constructor, you can give names to the different fields of the structure (Haskell data constructors are closer to records I think, in that they are basically a tuple underwater, so without field naming you are forced to match on the xth’ position of the data structure). The only thing such a name does, is creating a function for your that extracts the value at that position in the data structure, and return it. If your code becomes more complex in the future, you can remove the name from the data structure, and write out a manual function definition instead.</p>
<p>I think this approach is better, in the sense that it keeps you open to alter <a href="http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to" rel="noopener nofollow ugc">or delete</a> your implementation in the future.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29686" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-29686" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29686"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="29743" data-post-id="29743">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="15" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>One thing that static typing nor Dialyzer would fix, is what happens when you write some code, publish it as a library, and then people start matching on your struct’s structure.</p>
<p>Because of backwards-compatibility, the structure of your struct is now ‘frozen’. The old fields will need to be kept in there because some other code might depend on it.</p>
</blockquote>
</aside>
<p>This is huge!  And also why many typed languages (like ocaml as one of many) do not export the internal type but instead have a set of accessors on the module of the type just for those reasons.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>In fact, OCaml goes so far as to make a special record type called ‘object’ that does not have its structure fully typed (so these are more like Elixir Structs, where Elixir has nothing as powerful as an OCaml record), but it allows you to match on specific parts of it too, so like:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">let thing = object
	method vwoop = 42
end

let extra_thing = object
	method vwoop = "a string!"
    method more = 42
end

let different = object
	method no_vwoop = "nope"
end

let i_accept_vwoops v = v#vwoop

let tests =
	let 42 = i_accept_vwoops thing in
    let "a string!" = i_accept_vwoops extra_thing in
    (* let "this will not compile" = i_accept_vwoops different in *)
    ()
</code></pre>
<p>So if you uncomment that one line (I think the forum’s syntax coloring for other languages is broken… but it is the line surrounded in <code>(* ... *)</code>) then it will not compile because the <code>different</code> object does not have a <code>vwoop</code>.  Also, vwoop is a function, so you can change it later to do something else, like look up a value as in:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">let thing = object
	val this_is_not_accessible_externally = 2
	method vwoop = 42 * this_is_not_accessible_externally
end

let extra_thing = object
	method vwoop = "a string!"
    method more = 42
end

let different = object
	method no_vwoop = "nope"
end

let i_accept_vwoops v = v#vwoop

let tests =
	let 84 = i_accept_vwoops thing in
    let "a string!" = i_accept_vwoops extra_thing in
    (* let "this will not compile" = i_accept_vwoops different in *)
    ()
</code></pre>
<p>I transparently change <code>thing#vwoop</code> to do an operation, which it does on call (even though it could be done inline in this case I guess…), but it is a normal function, can do whatever you want.  <code>val</code>’s are not exposed externally, but can still be whatever you want internally), and <code>method</code>’s are exposed externally as the ‘interface’ for interacting with the object, they can even return a copy of the object with val’s or method’s changed too, such as in:</p>
<pre data-code-wrap="ocaml"><code class="lang-ocaml">let create_thing init = object
	val i_am_hidden = init
	method vwoop = (i_am_hidden, {&lt;i_am_hidden = i_am_hidden * 2&gt;})
end

let tests =
	let thing = create_thing 21 in
	let (21, thing2) = thing#vwoop in
	let (42, thing3) = thing2#vwoop in
	()
</code></pre>
<p>Yes this is the barest part of the immutable object system in OCaml, but this is the part that is most used (almost no one uses the inheritance and such because it is just not needed).  But these I can see in Elixir as a combination struct and module, which could perhaps also be called an object, so going with your idea I could maybe imagine a syntax like, hmm, actually I just hacked this together so this code works:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defobject MyTesting(init) do
  val blah = init

  def vwoop(mult) do
    blah * mult
  end
end
</code></pre>
<p>And the iex session:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; thing = MyTesting.make(21)
...
iex&gt; thing.vwoop(2)
42
iex&gt; thing.blah
** (UndefinedFunctionError) ...
iex&gt; thing.vwoop
** (UndefinedFunctionError) ...
</code></pre>
<p>A couple minor changes to the syntax (but more work then I’ve done currently) would be able to return altered versions of its current state, like in the OCaml example.  ^.^</p>
<p>I’d probably also change <code>make</code> to be <code>new</code> instead, OCaml uses <code>make</code> to make new things and that was the mindset I was in.  ^.^</p>
<p>However yes, if you expose your type then it is hard to change it, hence why you should not expose your type, make it opaque, like in the OCaml world, dialyzer has a <code>-opaque</code> type declaration for a reason. <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29743" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-29743" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29743"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="29744" data-post-id="29744">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mgwidmann" data-post="14" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mgwidmann/48/7249_2.png" class="avatar"> mgwidmann:</div>
<blockquote>
<p>No one wants to give up the flexibility of dynamic typing.</p>
</blockquote>
</aside>
<p>I personally find static typing to be far more flexible in terms of not needing to worry that my data is being accessed properly.  Think of OCaml, you almost never need to specify a type anywhere (see my examples in prior post), it ‘looks’ dynamically typed, but it is not, it is one of the most strongly typed languages out, but with nary a type in sight, you get flexibility and security that things are <em>right</em> both.  <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29744" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-29744" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29744"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="29751" data-post-id="29751">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Creating a macro that accepts a bit of Elixir ast and transforms all dot access statements to equivalent calling code is not that difficult. You could even create a custom version of <code>defmodule</code> so it is completely hidden from view.</p>
<p>But of course, the static access operator was made ‘unoverridable’ for a reason: Because what you now end up with, looks very much like implicit <code>foo.bar.baz.qux</code> OOP method dispatch syntax.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29751" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-29751" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29751"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="29757" data-post-id="29757">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="18" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>But of course, the static access operator was made ‘unoverridable’ for a reason: Because what you now end up with, looks very much like implicit foo.bar.baz.qux OOP method dispatch syntax.</p>
</blockquote>
</aside>
<p>Which is why I am not publishing this.  <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>However, what you are proposing would allow the same thing, would it not?  And really, a record/struct/map of anonymous functions is really just that anyway.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29757" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-29757" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29757"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="29785" data-post-id="29785">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="OvermindDL1" data-post="19" data-topic="4509" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<aside class="quote no-group" data-username="Qqwy" data-post="18" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>But of course, the static access operator was made ‘unoverridable’ for a reason: Because what you now end up with, looks very much like implicit foo.bar.baz.qux OOP method dispatch syntax.</p>
</blockquote>
</aside>
<p>Which is why I am not publishing this.  <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>However, what you are proposing would allow the same thing, would it not?  And really, a record/struct/map of anonymous functions is really just that anyway.</p>
</blockquote>
</aside>
<p>An important difference with a struct filled with anonymous functions is that ones functionality will be altered when the module is reloaded, and one will not.</p>
<p>Anyhow, I like <code>Foo.bar(my_foo)</code> a lot better than <code>my_foo.bar</code>, because it is more explicit and pipeable.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29785" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-29785" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29785"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="29788" data-post-id="29788">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="20" data-topic="4509">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>Anyhow, I like Foo.bar(my_foo) a lot better than my_foo.bar, because it is more explicit and pipeable.</p>
</blockquote>
</aside>
<p>Would be in mine as well, instead of <code>thing.vwoop(2)</code> you can do <code>MyTesting.vwoop(2, thing)</code> (I’m using Erlang functionality, which puts the thing into the last slot as it should be, unlike Elixir’s weird way, and I cannot fix that, however I could swap it if it is detected in the last slot with ease though in the macro case generator).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29788" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/the-issue-with-the-static-access-operator-the-dot/4509/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-29788" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29788"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/4509/load_more?page=3">Load more posts (4 remaining)</a>
</div></template></turbo-stream>