12 Matching Annotations
  1. Aug 2025
  2. siraj-samsudeen.github.io siraj-samsudeen.github.io
    1. # Access fields (same as maps)

      Field Access: Structs are NOT the same as Maps

      The comment "(same as maps)" is misleading.

      • Maps: Support both map.key and map[:key] access
      • Structs: Only support struct.key dot notation
      • Bracket notation struct[:key] is not work with structs

      Proof

    2. |> System.system_time()

      Logic error: Cannot pipe to System.system_time() - this function doesn't accept string input.

      • According to Elixir docs: System.system_time() :: integer() - takes no arguments and returns an integer
      • System.system_time(unit) variant takes only a time unit parameter, not piped string data
    3. Required for zero-argument functions data |> String.trim()

      String.trim() is NOT zero-argument

      • String.trim/1 requires a string argument
      • String.trim/2 optionally takes characters to trim

      Comment "zero-argument functions" is wrong

    4. go to this page, install elixir and do the steps mentioned there to say hello world interactively in iex and by running an elixir code file. Elixir Installation Guide

      The essential installation link is provided at the end after all the instructions. Is it okay?