<< 16-07-2026 >>

02:40:19*zodman quit (Ping timeout: 245 seconds)
08:04:06*skippy8 joined #nim
08:32:10*Jhonny2x4 quit (Quit: Jhonny2x4)
08:32:26*Jhonny2x4 joined #nim
08:52:28*skippy8 quit (Ping timeout: 244 seconds)
10:34:51*skippy8 joined #nim
11:30:26*skippy8 quit (Ping timeout: 242 seconds)
13:28:32*tty303 joined #nim
13:29:10*vival quit (Ping timeout: 261 seconds)
13:30:21*vival joined #nim
13:30:43*Mister_Magister quit (Remote host closed the connection)
13:31:04*mal`` quit (Quit: Leaving)
13:31:09*Mister_Magister joined #nim
13:31:22FromDiscord<gmpreussner> In reply to @im_rob "Hello all. I've been": only had a quick look over your code. one thing that stuck out is that you could use `range[...]` for range bound types
13:31:32FromDiscord<gmpreussner> instead of `int` parameters
13:31:48*th3r00t quit (Read error: Connection reset by peer)
13:34:49*mal`` joined #nim
13:36:07*termer quit (Remote host closed the connection)
13:37:41*termer joined #nim
13:41:11*beholders_eye joined #nim
13:45:13FromDiscord<Emmanuel M. Smith 🔸> On the topic of ranges, you can create them for enums but they must be contiguous, is there a way to have something similar to a range over an enum, but skipping over some of the enum values? I've had a use case for this for a while↵(@gmpreussner)
13:47:08FromDiscord<gmpreussner> In reply to @Emmanuel M. Smith 🔸 "On the topic of": not sure I understand. Enums already constrain the allowed input values!? are you talking about an enum set, i.e. passing multiple enum values?
14:21:24*beholders_eye quit (Ping timeout: 245 seconds)
14:24:30FromDiscord<mratsim> In reply to @gmpreussner "not sure I understand.": you can constrain subranges
14:25:30FromDiscord<mratsim> In reply to @gmpreussner "not sure I understand.": for example: https://github.com/mratsim/golem-prime/blob/8953347e2d659a2fce81e03a3f3261e882a71e62/src/datatypes.nim#L35
14:25:33FromDiscord<gmpreussner> Oh I see, you want to allow only a substance of enums
14:25:43FromDiscord<gmpreussner> (edit) "substance" => "subrange"
14:59:18FromDiscord<Emmanuel M. Smith 🔸> Yeah, I can do it for contiguous sub ranges, hover if I want to exclude any don't think that works atm
15:05:57*beholders_eye joined #nim
16:04:07FromDiscord<im_rob> sent a code paste, see https://play.nim-lang.org/#pasty=PTkvYFBJ
16:04:56FromDiscord<im_rob> Which looking at it now, looks a tad strange. I haven't touched this module since I first learned of ranges in nim.
16:25:53*zodman joined #nim
16:28:27*skippy8 joined #nim
16:36:19*xet7 joined #nim
17:05:16FromDiscord<mratsim> In reply to @im_rob "I have these: ": RGB is better represented as uint8. It would uses 8x less memory.
17:11:33FromDiscord<_timurski> ^
17:12:00FromDiscord<_timurski> percent also being 0..100 int is quite strange
17:12:25FromDiscord<_timurski> i would just store a [0, 1] float
17:15:39FromDiscord<im_rob> thank you lads. Both good points
17:30:19*beholders_eye quit (Ping timeout: 245 seconds)
17:43:22*xet7 quit (Remote host closed the connection)
18:06:53*skippy8 quit (Ping timeout: 266 seconds)
18:23:50FromDiscord<0ffh> But if you do adapt the name - [0, 1] is a fraction, not a percentage.
18:32:57*xet7 joined #nim
18:33:33*xet7 quit (Remote host closed the connection)
18:47:29FromDiscord<cobaltdsc4102> Would the compiler not optimise it down anyway?
19:07:13FromDiscord<tomas198011> Is there anyone looking for a engineer or team?
19:24:11FromDiscord<_timurski> In reply to @cobaltdsc4102 "Would the compiler not": the compiler would definitely not optimize down a int 0-100 value to a float, they're completely different