jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
seanohue has quit [Ping timeout: 259 seconds]
seanohue has joined #ponylang
jemc has quit [Ping timeout: 255 seconds]
seanohue has quit [Ping timeout: 264 seconds]
seanohue has joined #ponylang
seanohue has quit [Ping timeout: 240 seconds]
seanohue has joined #ponylang
TwoNotes has joined #ponylang
jemc has joined #ponylang
seanohue has quit [Ping timeout: 245 seconds]
TwoNotes has left #ponylang [#ponylang]
seanohue has joined #ponylang
seanohue has quit [Ping timeout: 240 seconds]
seanohue has joined #ponylang
c355e3b has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 240 seconds]
seanohue has quit [Ping timeout: 245 seconds]
graaff has joined #ponylang
graaff has quit [Quit: Leaving]
TonyLo has joined #ponylang
TonyLo has quit [Client Quit]
TonyLo has joined #ponylang
_andre has joined #ponylang
Matthias247 has joined #ponylang
jkleiser has joined #ponylang
aav_away has quit [Ping timeout: 240 seconds]
aav_away has joined #ponylang
c355e3b has joined #ponylang
graaff has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
Matthias247 has joined #ponylang
aav_away is now known as aav
dougmacdoug has joined #ponylang
jkleiser has quit [Remote host closed the connection]
jkleiser has joined #ponylang
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
jemc has joined #ponylang
jkleiser has quit []
graaff has quit [Quit: Leaving]
amclain has joined #ponylang
<SeanTAllen> I dont have an SO account.
<SeanTAllen> We don't have exhaustive match so, the None is a result of that. Exhaustive match is an open issue that needs to be addressed. It sounds like you've found a bug. `with` isn't widely used so it doesn't surprise me. I think you should open an issue for this aav and we can discuss at the sync. Sounds like a bug to me.
<SeanTAllen> but, i could be wrong
<jemc> as SeanTAllen says, `with` isn't widely used (I've actually never used it myself)
<jemc> but I think it's acting like a `try` block here, in that it expects that an `error` is possible within the block, so unless you provide an `else` block, the implicit `else` block is simply `else None`
<jemc> I agree with SeanTAllen that it needs discussing on the sync call - particularly, the "try expression never results in an error" message you see
<aav> so, the bottom line is - avoid using 'with'?
<aav> but what is the idiomatic way to ensure that resource (i.e. file) is closed under any condition?
<SeanTAllen> aav i wouldnt say that, im saying you might encounter some issues that need to get fixed. at the moment, i think you might be blocked. `with` would be idiomatic but i don't think its used much because people would normally have the resource exist for the lifetime of an actor in which case `with` doesn't ever get used.
<jemc> aav: well, arguably `with` was created to be the idiomatic way to do that, though because in practice it doesn't get a lot of use, it may be rough around the edges
<SeanTAllen> yes, what jemc said, better than i
<jemc> was about to say that you said it better :P
<SeanTAllen> ha
<SeanTAllen> agree to disagree on who said it better
<jemc> aav: the `files` package is probably the most common usage of the `with` block - I think that's probably because the `dispose` idiom is mostly used among actors, and `with` is only really useful for disposable synchronous objects
<jemc> I don't know of other synchronous APIs that use `dispose` other than the `files` package, though it seems like a nice idiom for the rare cases where you want to explicitly dispose a synchronous object
TonyLo has quit [Ping timeout: 256 seconds]
TonyLo has joined #ponylang
<TonyLo> Is there a way to get a hash of an actor? I want to create a HashSet of Actors
<jemc> TonyLo: have you seen the ``HashIs` hash function in `collections/hashable.pony`?
<TonyLo> looking now, thx
<jemc> I think what you want to use is `SetIs` for your set
<jemc> `SetIs[MyActorInterface] is probably what you want
_andre has quit [Quit: leaving]
<TonyLo> yes, this looks good thx
<jemc> since `SetIs` is defined as a `HashSet` using the `HashIs` function
<jemc> `type SetIs[A] is HashSet[A, HashIs[A!]]`
<jemc> incidentally, this is pretty much the only useful use of the `digestof` operator, which returns a number that can be used to "uniquely" identify an object instance
<TonyLo> thx
<jemc> it used to be called `identityof`, but we changed the name to discourage other uses besides hashing - https://github.com/ponylang/ponyc/issues/774
<jemc> mainly because there are some edge cases where the `identity` isn't totally unique
<jemc> the uniqueness problems really only start popping up when you get the "identity" of an object to a number, or some other uncommon cases like that
<TonyLo> ok, thx for the value add :)
TwoNotes has joined #ponylang
<TwoNotes> Is there a way to put a MD link syntax into a Pony comment so that it will turn up as an HTML link in the generated stdlib documentation?
<TwoNotes> I am writing the package-level documentation, and I want to provide links to the key interfaces.
<jemc> TwoNotes: I think you should be able to do something like `[MyType](my_package-MyType)`
<TwoNotes> I will try that and see how mkdocs transforms it.
<TwoNotes> Is the package name 'net/http' or just 'http'?
<jemc> TwoNotes: you can see the correct "fully qualified type name" in the last segment of the URL when you have the page for that type up in your browser
<jemc> `net-http` would be the package name
aav has quit [Quit: Lost terminal]
aav has joined #ponylang
aav has quit [Client Quit]
aav has joined #ponylang
<dougmacdoug> noob here, has there been any consideration to relax the naming restrictions to allow underscore in class names? Easy_To_Read
<aav> FilePath.create() is declared as partial, OpenFile.apply() returns (File | FileErrNo). when is it idiomatic to make function partial, and when to return some error status?
<aav> like in the example above?
Matthias247 has quit [Read error: Connection reset by peer]
<jemc> aav: in general, it's idiomatic to use a partial function when there is only one reason why an error occurred - there's no ambiguity in the error, and the docs should indicate what the error (always) means
<jemc> for example, the docs for `Array.apply` say: "Get the i-th element, raising an error if the index is out of bounds."
<jemc> so if you get an error, you know exactly what it means (index out of bounds)
<jemc> this is the preferred idiom wherever possible, because it keeps things quite simple
<jemc> however, sometimes you do need to convey some information, so another idiom is appropriate
<jemc> returning a type union where one type indicates success, and others different kinds of failure is one idiom for that
<jemc> another idiom would be accepting a notifier object or lambda that will be called when an error occurs, passing any necessary value(s) as arguments to the call
<jemc> this idiom is common on asynchronous objects, but could also be used synchronously
<jemc> adding some of these idioms and conventions to the "pony patterns" documentation (https://github.com/ponylang/pony-patterns) is a topic of recent discussion
<jemc> there is also an outstanding proposal to add another error handling mechanism to the language, though it still has some outstanding concerns: https://github.com/ponylang/rfcs/pull/76
aav has quit [Ping timeout: 240 seconds]
seanohue has joined #ponylang
<SeanTAllen> dougmacdoug: No. There hasn't been any consideration of that.
<dougmacdoug> I use CamelCase in java and c# on a regular basis, but I have gotten used to using Snake_Case on other compiled languages and I just find the latter so much easier to read
<jemc> I'm not totally sure, but I believe there were some technical restrictions (related to name munging) that prevent using underscores in type names
<jemc> if those technical restrictions could be cleared (or if they don't actually exist), I personally would be in favor of allowing underscores in type names
<jemc> I think CamelCase is most appropriate as a convention, but I've sometimes wished for being able to do things like MyCategory_MyType for better organizing type names in some cases
<jemc> or MY_CONSTANT_NAME for types that are "emulating" constants
aav has joined #ponylang
<aav> jemc: thank you, hope i'm not too annoying with such questions
<jemc> nope, not annoying at all - always happy to answer questions :)
<aav> jemc: like with any new language i'm trying to get the feeling of what is the right way to do things
rurban has joined #ponylang
<jemc> definitely
<aav> jemc: when i look at FilePath.create i can see, that it raises error in three distinct conditions -
<jemc> and in some cases, so are we ;)
<aav> 1 - missing capability, 2 - empty path, 3 - 'else' case in the match (actually it will never be reached)
<jemc> aav: looking at the code, actually, the second condition is more like: "absolute path was given, and didn't use AmbientAuth"
<jemc> docs for `Path.join` says it will return the path unchanged if it is absolute
rurban has left #ponylang [#ponylang]
<jemc> so the check for `path.at(b.path, 0)` is used to check if the root path is indeed at the root (index 0) of the new path
<jemc> so if that check fails, it means the user gave an absolute path
<jemc> so, other than the unreachable error, the possible errors could be summarized as "insufficient permissions to access that path"
<aav> jemc: i see
<TwoNotes> WHat is the procedure for submitting a pull request to ponyc-master?
<aav> jemc: then, last for today - would you consider this function idiomatic and correct - https://gist.github.com/aav/f0c1bf47793a2bc2e901228e1078911f ?
<jemc> TwoNotes: are you familiar with the general process of doing a PR to a repo using GitHub?
<TwoNotes> Yes
<TwoNotes> I read about squashing commits, trying to do that now
<TwoNotes> It gives me a tect file containing 'pick' commands and a bunch of comment
<jemc> ah, okay, I can help you squash
<jemc> replace each instance of the word `pick` with `squash`
<jemc> then save the file
<TwoNotes> EACH occuerance? It says squash all but the first
<TwoNotes> I have 5 commits. pick, then 4 squashes?
<jemc> sorry, yes, `pick` the first one
<jemc> or `edit` if you want to change the message
<jemc> also, squashing is preferred, but we can also squash-on-merge if squashing ahead of time is too much of a burden for the contributor
<TwoNotes> I put the word "edit" in place of "pick"?
<jemc> yes
<TwoNotes> So 'edit', then 4 squashes, exit
<jemc> sorry, forgot about `reword` - you should use `reword` instead of `edit` if you only want to change the commit message, and not the content
<TwoNotes> Ok I think I got it
<TwoNotes> git log shows only the one commit now
<TwoNotes> But git branch shows me on a (no branch, rabasing) line
<jemc> `git rebase --continue` is what you need I think
<TwoNotes> Now I lost it. I have to start over. Luckily I saved the whole repo fist
<jemc> sorry
<jemc> as I mentioned, if it's too much burden, feel free to push it up as-is, and we can squash on merge
<jemc> I don't want contributors being frustrated by procedure, when we have a workaround we can use
<jemc> aav: I can say it doesn't look very pleasant to me, but it's not your fault
<jemc> we were having a discussion just this week about not being totally happy with how the File API handles errors
<jemc> I think your gist is a good example of something that should be much easier and prettier than it is, highlighting a need for making the File API better
aav_ has joined #ponylang
adamkittelson_ has joined #ponylang
jtfmumm__ has joined #ponylang
gornikm_ has joined #ponylang
omarkj_ has joined #ponylang
darach_ has joined #ponylang
SparkySparkyBoom has joined #ponylang
<aav_> jemc: yep
<aav_> and exhaustive pattern matching would also help a lot
aav has quit [*.net *.split]
M-hrjet has quit [*.net *.split]
darach has quit [*.net *.split]
gornikm has quit [*.net *.split]
flippant has quit [*.net *.split]
omarkj has quit [*.net *.split]
adamkittelson has quit [*.net *.split]
bodie_ has quit [*.net *.split]
jtfmumm- has quit [*.net *.split]
emilbayes has quit [*.net *.split]
jtfmumm_ has quit [*.net *.split]
jtfmumm__ is now known as jtfmumm_
gornikm_ is now known as gornikm
bodie_ has joined #ponylang
darach_ is now known as darach
omarkj_ is now known as omarkj
adamkittelson_ is now known as adamkittelson
seanohue has quit [Ping timeout: 258 seconds]
M-hrjet has joined #ponylang
aav_ is now known as aav_away