https://linen.dev logo
Join Discord
Powered by
# haxe
  • b

    bulky-insurance-39338

    09/30/2022, 12:32 AM
    And not all maybe wanna learn
    macro
    -feature to ⛵ around that language-cliff i mean
  • b

    bulky-insurance-39338

    09/30/2022, 12:34 AM
    @most-whale-66776 do you also think sometimes there is something not -> completed? (from
    p u r e
    languagelogic i mean )
  • b

    bulky-insurance-39338

    09/30/2022, 12:39 AM
    @plain-whale-70732 what is your
    real
    usecode for ? (or also language-exploring often ^^) ?
  • p

    plain-whale-70732

    09/30/2022, 12:41 AM
    @bulky-insurance-39338 real use-case is creating an static extension method for
    Array<T>
    which can count the "most frequently occurring member". I.e, if i have
    var dir = [NORTH, EAST, WEST, EAST, SOUTH, EAST].mostFrequent()
    , you get
    dir = EAST
  • p

    plain-whale-70732

    09/30/2022, 12:42 AM
    The original plan was to iterate the array, keeping track of counts insides the
    Map
    .
  • b

    bulky-insurance-39338

    09/30/2022, 12:43 AM
    ahhh .. so for -> OPTIMIZATION 💓 ?
  • p

    plain-whale-70732

    09/30/2022, 12:43 AM
    @bulky-insurance-39338 I decided to just stick with
    <Int>
    only for now
  • p

    plain-whale-70732

    09/30/2022, 12:44 AM
    just got rid of the generic
    CountTable<T>
    idea
  • p

    plain-whale-70732

    09/30/2022, 12:44 AM
    For a count table in different lang, see this: https://nim-lang.org/docs/tables.html#basic-usage-counttable
  • b

    bulky-insurance-39338

    09/30/2022, 12:45 AM
    (any -> try a
    @:generic
    also at now [better now than later .. especially into hashlink;])
  • r

    refined-laptop-39041

    09/30/2022, 12:45 AM
    Haxe Roundup Roundup
    a
    a
    b
    • 4
    • 33
  • a

    ambitious-knife-25690

    09/30/2022, 1:02 AM
    Sorry i went away, this is the closest I can get lol
  • a

    ambitious-knife-25690

    09/30/2022, 1:02 AM
  • p

    plain-whale-70732

    09/30/2022, 1:03 AM
    thanks for the attempts!
  • p

    plain-whale-70732

    09/30/2022, 1:04 AM
    Copy code
    var table = new MyTable<Direction, Map<Direction, Int>>();
  • p

    plain-whale-70732

    09/30/2022, 1:04 AM
    that just renders it unusable sadly
  • a

    ambitious-knife-25690

    09/30/2022, 1:05 AM
    no worries, was a fun hack attempt
  • a

    ambitious-knife-25690

    09/30/2022, 1:06 AM
    i think there's an evolution for more type constraints anyway
  • b

    bulky-insurance-39338

    09/30/2022, 1:09 AM
    ->
    N S E W NE NW SE SW
  • p

    plain-whale-70732

    09/30/2022, 1:09 AM
    Unfortunately, constraints are only
    AND
    , and can't be `OR`'d
  • b

    bulky-insurance-39338

    09/30/2022, 1:09 AM
    -->
    north north west
  • b

    bulky-insurance-39338

    09/30/2022, 1:09 AM
    *lol
  • b

    bulky-insurance-39338

    09/30/2022, 1:10 AM
    🧭
  • b

    bulky-insurance-39338

    09/30/2022, 1:10 AM
    by
  • p

    plain-whale-70732

    09/30/2022, 1:11 AM
    I wonder if you could make a
    TypeDef
    which provides a
    .toMapKey()
    function - similar to build int
    Iterable
    . Then you could implement that for all the base types (
    Int
    ,
    EnumValue
    ,
    String
    )
  • b

    bulky-insurance-39338

    09/30/2022, 1:13 AM
    -> north by northwest
  • b

    bulky-insurance-39338

    09/30/2022, 1:15 AM
    ( dd mills .. do you know that old movie * ;: ~ .. ^° °^ `?= )
  • b

    bulky-insurance-39338

    09/30/2022, 1:18 AM
    ( )
  • m

    most-whale-66776

    09/30/2022, 1:26 AM
    this doesn't work the way you think it would. it would be better if all the base types had this method by default
  • m

    most-whale-66776

    09/30/2022, 1:27 AM
    for example in c#, every type has a .ToHashCode() method that maps use, even primitives
1...484648474848...6261Latest