Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 06:41
    pepe commented #683
  • 02:34
    sogaiu commented #683
  • 02:28
    sogaiu commented #683
  • 01:57
    crocket commented #683
  • 01:33
    crocket commented #683
  • 00:18
    uvtc commented #683
  • Apr 15 23:18
    andrewchambers commented #683
  • Apr 15 23:13
    sogaiu commented #683
  • Apr 15 19:58
    bakpakin closed #682
  • Apr 15 19:58

    bakpakin on master

    Fix #682 - Don't hardcode size … (compare)

  • Apr 15 16:03
    uvtc commented #683
  • Apr 15 04:20
    sogaiu commented #683
  • Apr 15 04:10
    pyrmont commented #683
  • Apr 15 03:54
    crocket edited #683
  • Apr 15 03:53
    crocket opened #683
  • Apr 15 00:18
    bakpakin closed #678
  • Apr 12 19:11
    littleli commented #533
  • Apr 12 12:56
    sogaiu opened #116
  • Apr 12 01:28
    bakpakin labeled #682
  • Apr 11 00:13
    DEADB17 edited #682
Saikyun
@Saikyun
@pyrmont do you have a specific example for repling / blocking problem?
don't know if it will help you, but this is how I manage to get netrepl + loop to work together: https://github.com/Saikyun/text-experiment/blob/main/src/main.janet#L217-L235
the ev/sleep call makes it so that the netrepl gets a chance to do its thing :)
when thinking about it, a generator might have been cleaner, haha. anyway :)
Michael Camilleri
@pyrmont
I've got it working now :)
I'm running the netrepl server in a separate process so it's OK for recv to block, just not indefinitely :)
Saikyun
@Saikyun
ah right, in my case I couldn't run netrepl in a separate process / thread, due to having to run raylib calls on main thread
Michael Camilleri
@pyrmont
Ah. Yeah, I'm just trying to play around with some of the stuff that I helped add to run-context and spork/netrepl.
I was trying to get Conjure to work with it but I am not having much luck and am trying to see if something's broken in the implementation (I don't think it is but wanted to double check).
pp
@damnpepe:matrix.org
[m]
lol
dogfooding
Michael Camilleri
@pyrmont
Well, sort of :)
More like bearpoking :P
pp
@damnpepe:matrix.org
[m]
😀
no danger I would say
not from Janet codes, they are helpful only
Michael Camilleri
@pyrmont
Or like that scene in 80s action movies where they have to cut the right wire to defuse the bomb while the wrong wire will explode.
pp
@damnpepe:matrix.org
[m]
oh the adventures of SW development
why it was funny for me: I finished Chidi, very proud father. Then I put it to work in the good-place website and found a lot of the rough edges
some parts got total overhaul
Michael Camilleri
@pyrmont
Yeah, this is not acting the way that I expected.
Which is a bit weird because it runs OK when testing.
pp
@damnpepe:matrix.org
[m]
one of the famous last sentences 🙂
Saikyun
@Saikyun
haha, I just deployed customer facing code to prod, so definitely feel that ^^;
pp
@damnpepe:matrix.org
[m]
lol
Lue
@luewd:matrix.org
[m]
I got some ordered tables working
was pretty easy. idk what's the most efficient but I found dict of key to index + array of keys + array of values the easiest to implement
4 replies
andrewchambers
@andrewchambers
nice
andrewchambers
@andrewchambers
super strange
im on my laptop and pretty printing is working here
maybe a different version of janet...
hmmm
Leah Neukirchen
@leahneukirchen
why is (compare> @[2 1] @[4 1]) not (compare> [2 1] [4 1])
Saikyun
@Saikyun
not 100% sure, but I think many comparisons doesn't really work with arrays / buffers
e.g. (= @[1 2] @[1 2]) #=> false
because it compares the pointers
with = there's deep= which works with those. not sure if there's something similar for compare>
2 replies
Leah Neukirchen
@leahneukirchen
well = makes sense, but for comparison i need to look at the elements, it shouldnt care if it's tuples or arrays
i dont even want to compare tuples with arrays
Saikyun
@Saikyun
I guess that makes sense :) no clue then
bakpakin
@bakpakin:matrix.org
[m]
No, simple comparison does not compare by internal values for all of them same reasons that equality doesn't
Lue
@luewd:matrix.org
[m]
it'll be nice to add more things like put-in, swap-remove, index-based put/get/remove, and more
I think I will publish as standalone module since it's pretty easy to implement this all :)
I was doing it as part of another project at first since I didn't want to get carried away with a rabbit hole of libraries just to implement one program, but the way I'm implementing the ordered table is basically decoupled from rest of project anyway
John Gabriele
@uvtc

Regarding testing for equality, I really like Janet's consistency here: that all immutables compare by value, and all mutables compare by pointer (or id):

# All of these (immutables) evaluate to `true`:
(= nil nil)
(= false false)
(= 1 1)
(= :a :a)
(= 'a 'a)
(= "a" "a")        # string
(= [1 2] [1 2])    # tuple
(= {:a 1} {:a 1})  # struct

# ...and all of these (mutables) evaluate to `false`:
(= @"a" @"a")        # buffer
(= @[1 2] @[1 2])    # array
(= @{:a 1} @{:a 1})  # table

(please let me know if I have any of that terminology wrong)

Lue
@luewd:matrix.org
[m]
yeah I really like that immutables are compared by value too
Lue
@luewd:matrix.org
[m]
hey, I did post it since then :)
pp
@damnpepe:matrix.org
[m]
sorry I am too sequential, thank you very much, looking at it
it looks fine. Thank you!
Lue
@luewd:matrix.org
[m]
the one I linked early is pretty minimalistic