johshoff_ has quit [Remote host closed the connection]
aturley has quit [Quit: aturley]
dipin has quit [Quit: dipin]
aturley has joined #ponylang
<SeanTAllen>
if you want to read 1 byte then you don't want to read into a u32.
<SeanTAllen>
codec1: Reader/Writer can be used for non-network data but it would be the most likely usecase
<SeanTAllen>
Candle: I'm not in favor of adding "len" parameter to Reader functions. That's going to require an RFC and I don't think that makes a good API. Please read 8 bytes into a U32 is a rather specialized thing to do. I don't think that should be read into a U32.
markmarkmark has quit [Ping timeout: 240 seconds]
markmarkmark has joined #ponylang
jemc has quit [Ping timeout: 264 seconds]
samuell has joined #ponylang
aturley has quit [Quit: aturley]
SenasOzys has joined #ponylang
endformationage has joined #ponylang
jemc has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
jemc has quit [Ping timeout: 240 seconds]
dipin has joined #ponylang
user10032 has joined #ponylang
notsgnik has quit [Ping timeout: 255 seconds]
notsgnik has joined #ponylang
codec1 has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
SenasOzys has quit [Ping timeout: 248 seconds]
user10032 has quit [Quit: Leaving]
SenasOzys has joined #ponylang
dipin has quit [Quit: dipin]
vaninwagen has joined #ponylang
dipin has joined #ponylang
<Candle>
SeanTAllen: I'd come to the conclusion that Reader wasn't the right thing anyway. Partly because the 'peek' set of functions, which I'd have to use exclusively, don't opperate on just one array, but a list of arrays, and therefore have a series of loops; and partly due to the complicated API (At 13:57:27 (My time) I did state a concern over complicated APIs.)
codec1 has joined #ponylang
<notsgnik>
hello everyone, can some kind person tell me is there a way of creating a define in pony? :p
<notsgnik>
sorry i think i found my answer
<notsgnik>
primitive Red fun apply(): U32 => 0xFF0000FF
<notsgnik>
how can i print a floating point ? there is no .string() function to the class :/
gokr has joined #ponylang
ShalokShalom has quit [Remote host closed the connection]
SirRolin has joined #ponylang
samuell has quit [Quit: Leaving]
<Candle>
notsgnik: Odd, because F{32,64} are both FloatingPoint, which is Real, which is Stringable. There's the https://stdlib.ponylang.org/format--index format package too.
codec1 has quit [Quit: Leaving.]
codec1 has joined #ponylang
samuell has joined #ponylang
<SirRolin>
is there a way to put an array into a lambda function?
samuell has quit [Ping timeout: 240 seconds]
samuell has joined #ponylang
DDR has quit [Ping timeout: 258 seconds]
samuell has quit [Quit: Leaving]
DDR has joined #ponylang
<SeanTAllen>
SirRolin: what do you mean "put an array into a lambda function"? do you have code that demonstrates the problem you are having?
<SeanTAllen>
notsgnik: do you have code that demonstrates the problem you are having?
<SirRolin>
so the recover val was what I needed to make [] array work, it seems. together with a try on the array. thanks Sean :)
<SeanTAllen>
i have a question SirRolin
<SeanTAllen>
the if x > 5, what is that?
<SirRolin>
that was because I didn't want it to overflow the array, but the try else fixes that XD
<SeanTAllen>
ok
<SeanTAllen>
that would still be an error
<SeanTAllen>
well
<SeanTAllen>
rather
<SeanTAllen>
your logic is wrong
<SeanTAllen>
your array is size 4
<SirRolin>
should had been x >= 5
<SeanTAllen>
the max index is 3
<SirRolin>
oh yeah
<SeanTAllen>
but yes, try else around the entire thing is probably what you want without that check
<SeanTAllen>
although
<SeanTAllen>
if you expect it to be out of bounds a lot, using an `error` with try/else will be slower than checking to make sure your index isnt out of bounds
<SirRolin>
once again, thanks sean, you are of great help :)
SenasOzys has quit [Ping timeout: 240 seconds]
<SeanTAllen>
you're welcome
SenasOzys has joined #ponylang
markmarkmark has quit [Quit: WeeChat 1.9]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
vaninwagen has quit [Ping timeout: 240 seconds]
aturley has joined #ponylang
SenasOzys has quit [Ping timeout: 276 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
gokr has quit [Ping timeout: 268 seconds]
alxs has joined #ponylang
oraoro has joined #ponylang
SirRolin has quit [Ping timeout: 260 seconds]
Praetonus has joined #ponylang
jemc has joined #ponylang
jemc has quit [Read error: Connection reset by peer]
metadave has joined #ponylang
jemc has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
codec1 has joined #ponylang
oraoro has quit [Ping timeout: 258 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<notsgnik>
ok, so the function apply is the "new create" for primitives
<codec1>
I don't think so
<notsgnik>
or only the default function that get called when using "()"
<notsgnik>
?
<codec1>
yes except if there is a constructor called new which would take those parameters
<codec1>
as far as I know
alxs has joined #ponylang
<notsgnik>
wow, it takes time to learn pony actually
<notsgnik>
and i'm not yet playing with iso, val and ref stuff ^^
<codec1>
well I would say the more the language try to protect against yourself
<codec1>
the more you have to learn its way of doing it
<notsgnik>
and he is right, cause i'm really just a monkey behind a keyboard :D
<codec1>
it depends of how you look at it
<codec1>
there are some simple construct that are safe that the compiler won't allow you to do
<codec1>
but the compiler can't have a deep understanding of what you are trying to achieve
<codec1>
so it has to keep to some clearly defined rules that gurantees the behavior of your program
<notsgnik>
and a mathematical proof :)
<codec1>
but it is not specific to Pony, there are plenty languages that lean toward statically enforced rules to have some kind of guarantees such as Rust, Idris, etc...
<notsgnik>
to me it still looks better than go and rust
<codec1>
I don't think they are comparable
<codec1>
I like Rust but it is quite different from Pony
<codec1>
and go ,as far as I know, as a pretty weak type system
<notsgnik>
in term of bending the language to adatp to modern needs, pony ( to me ) doses a better job at keeping it redable
<SeanTAllen>
notsgnik: do you know why your example didnt compile?
<notsgnik>
the last one?
<notsgnik>
i forgot to call the apply function
<notsgnik>
and just referensed the name of the primitive instead
<SeanTAllen>
pony will not automatically convert types for you
<notsgnik>
k
<SeanTAllen>
it doesnt matter that PFloat is an F32
<SeanTAllen>
and F32 has string
<SeanTAllen>
you have to call string() on it if you want to convert to a string
<notsgnik>
i understood... no implicit conversions
user10032 has joined #ponylang
samuell has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
gokr has quit [Ping timeout: 240 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
nisanharamati has joined #ponylang
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
codec1 has joined #ponylang
_andre has quit [Quit: leaving]
vaninwagen has joined #ponylang
gokr has joined #ponylang
xllndr has joined #ponylang
acarrico has quit [Ping timeout: 276 seconds]
samuell has quit [Ping timeout: 276 seconds]
DDR has quit [Ping timeout: 258 seconds]
DDR has joined #ponylang
samuell has joined #ponylang
xllndr has quit [Quit: Leaving]
vaninwagen has quit [Ping timeout: 250 seconds]
acarrico has joined #ponylang
acarrico has quit [Max SendQ exceeded]
user10032 has quit [Quit: Leaving]
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 276 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
gokr has quit [Ping timeout: 260 seconds]
codec1 has quit [Read error: Connection reset by peer]
samuell has quit [Quit: Leaving]
moony has joined #ponylang
<moony>
what is the compiler trying to tell me? All i see is a lot of 'iso'. /home/moony/Projects/pony-projects/lost-islands/src/ebs/entity.pony:9:34: Entity iso! is not a subtype of Entity iso: iso! is not a subcap of iso
<SeanTAllen>
moony: it would help to see the code
<SeanTAllen>
but iso!
<SeanTAllen>
means an alias of an iso
<SeanTAllen>
that's bad
<SeanTAllen>
so somewhere you are trying to either
<SeanTAllen>
1) share an iso by design (cant do that!)
<SeanTAllen>
2) you missed a consume of an iso
<moony>
oh shoot, i've been missing consumes everywhere.
<moony>
that explains it. Derp.
<moony>
(I always seem to forget consume exists. I just think it's implict half the time for some reason)
<moony>
Now just to figure out why array access seems to be adding the 'tag' capability and i can't figure out why.