ponylang / pony-tutorial

:horse: Tutorial for the Pony programming language
http://tutorial.ponylang.io
BSD 2-Clause "Simplified" License
308 stars 111 forks source link

Brought examples up to date with current Pony syntax and package requirements. #511

Closed redvers closed 2 years ago

redvers commented 2 years ago
redvers commented 2 years ago

I also noticed that the list of additional functions for TestHelper on the examples page contained a few methods that no longer exist and those that do exist as fun tag.

The pony_test documentation doesn't have the functions as fun tag… and it looks like the reason why that is is that TestHelper used to be an actor.

I just wanted to make sure that there wasn't any viewpoint adaptation or some other reason why they would be fun tag in the tutorial but not in the docs before I modified that too.

rhagenson commented 2 years ago

@redvers Will you list a couple of the functions that: a) no longer exist, and b) are now fun tag? I will take a look, but want to ensure I am working from the same list as you.

redvers commented 2 years ago

@redvers Will you list a couple of the functions that: a) no longer exist, and b) are now fun tag? I will take a look, but want to ensure I am working from the same list as you.

These from https://tutorial.ponylang.io/appendices/examples.html#how-to-write-tests image

No longer exist:

Wrong refcap:

Wrong refcap & args:

rhagenson commented 2 years ago

I cannot think of any reason they should be listed differently between the tutorial and documentation with regard to viewpoint adaptation or otherwise. (I also do not like the way that list in the tutorial is right now with regard to "Some assertions you can make with TestHelper are" being followed by a list with non-assertion methods.)

I need to review the rules around fun tag for my own purposes, but for moving this PR forward I cannot find any reason the Tutorial should not match stdlib documentation.

SeanTAllen commented 2 years ago

This is why in thought examples shouldn't be in the tutorial

rhagenson commented 2 years ago

It does feel odd to have examples. I think right now we are in the unfortunate space of needing examples to be somewhere and the tutorial being the most logical place for them. I have alluded to it on various calls, but one of my plans once I get RFC 200 (and other work I have already begun) completed, I want to work on an example-driven complement to the Tutorial.

SeanTAllen commented 2 years ago

I think all examples should be moved to the ponyc repo where we already have some and ci runs to make sure they work.

SeanTAllen commented 2 years ago

Or they should be part of standard library documentation. I think red has demonstrated pretty well that this section should be removed. It's at best duplicating information that should be elsewhere. These aren't particularly good examples either. They lack the explanation we have in both patterns and stdlib documentation and even the ponyc examples.

I'd rather delete this section and if there is anything here that people think is something that could have value, open issues for the appropriate creation.

rhagenson commented 2 years ago

I think having these examples in ponyc/examples/ makes sense. I also think removing them as part of this PR is not fitting.

redvers commented 2 years ago

I agree. I would agree that that removal should be separate.

Are there any other changes you need in this PR before approval?

rhagenson commented 2 years ago

I don't know of anything remaining to be done for this PR, however before this is merged will you change the title to reflect what these "small number of edits" are intended to do? The primary purpose is to make each modified block executable, yes?