- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Example Issue with Scala API Documentation and Scala Complexity
I was trying to figure out how to start up a process and capture and
went to
and the solution was immediately obvious. A picture really is worth a thousand words! It would be ever so helpful if the example presented on this web page could be added as an example in the scaladoc for ProcessLogger.
Having more good examples in the scaladoc would make learning and using Scala much more painless. I would update the scaladoc myself, if I knew how. Is it appropriate for me to enter solutions like this in JIRA?
Cheers, Eric
- http://www.scala-lang.org/api/current/index.html#scala.sys.process.Process
- http://www.scala-lang.org/api/current/index.html#scala.sys.process.ProcessBuilder
- http://www.scala-lang.org/api/current/index.html#scala.sys.process.ProcessLogger
and the solution was immediately obvious. A picture really is worth a thousand words! It would be ever so helpful if the example presented on this web page could be added as an example in the scaladoc for ProcessLogger.
val logger = ProcessLogger(
(o: String) => println("out " + o),
(e: String) => println("err " + e))
is significantly more helpful thandef err (s: ⇒ String): UnitI am a casual user of Scala, and between the scaladoc and Google searching, and rereading "Programming in Scala" - it was significantly more work than trying to figure out the equivalent functionality in Java.Will be called with each line read from the process error stream.
def out (s: ⇒ String): UnitWill be called with each line read from the process output stream.
Having more good examples in the scaladoc would make learning and using Scala much more painless. I would update the scaladoc myself, if I knew how. Is it appropriate for me to enter solutions like this in JIRA?
Cheers, Eric










Re: Example Issue with Scala API Documentation and Scala Comple
On Mon, Nov 28, 2011 at 5:41 PM, Erik Osheim <erik [at] plastic-idolatry [dot] com> wrote:
It might be possible to simplify the first two steps. If you navigate to the source file on github, you should be able to click "Fork and edit this file," which will let you edit it right in your browser in a fork. I'm not sure if it will reuse a previous fork you made.
Re: Example Issue with Scala API Documentation and Scala Comple
On Mon, Nov 28, 2011 at 5:41 PM, Erik Osheim <erik [at] plastic-idolatry [dot] com> wrote:
It might be possible to simplify the first two steps. If you navigate to the source file on github, you should be able to click "Fork and edit this file," which will let you edit it right in your browser in a fork. I'm not sure if it will reuse a previous fork you made.
Re: Example Issue with Scala API Documentation and Scala Comple
Overall the experience was a little harder than I wanted, but a lot easier than I expected.
Cheers, Eric
Re: Example Issue with Scala API Documentation and Scala Comple
Overall the experience was a little harder than I wanted, but a lot easier than I expected.
Cheers, Eric
Re: Re: Example Issue with Scala API Documentation and Scala C
ALSO -
Please don't cross-post to scala-user and scala-debate for discussion. scala-debate is for discussions, scala-user for "how do I use scala"
- Josh
On Tue, Nov 29, 2011 at 8:54 PM, Naftoli Gugenheim <naftoligug [at] gmail [dot] com> wrote:
Re: Re: Example Issue with Scala API Documentation and Scala C
ALSO -
Please don't cross-post to scala-user and scala-debate for discussion. scala-debate is for discussions, scala-user for "how do I use scala"
- Josh
On Tue, Nov 29, 2011 at 8:54 PM, Naftoli Gugenheim <naftoligug [at] gmail [dot] com> wrote:
Re: Example Issue with Scala API Documentation and Scala Comple
Done!
Thanks for workflow. Hopefully I followed your instructions correctly.
If so I'll make some more attempts to improve the documentation as I
encounter them.
The usual situation for me is that it can take an hour or more to figure
out how to do something correctly because there are few or no examples
to follow. When I figure things out I might as well document the working
examples I find :-)
Re: Example Issue with Scala API Documentation and Scala Comple
Done!
Thanks for workflow. Hopefully I followed your instructions correctly.
If so I'll make some more attempts to improve the documentation as I
encounter them.
The usual situation for me is that it can take an hour or more to figure
out how to do something correctly because there are few or no examples
to follow. When I figure things out I might as well document the working
examples I find :-)
Re: Example Issue with Scala API Documentation and Scala Comple
It would be nice if there was a link to this workflow on every page of the scaladoc. Something like "How to submit documentation improvements"
+1
2011/11/29 Eric Kolotyluk <eric [dot] kolotyluk [at] gmail [dot] com>
Re: Example Issue with Scala API Documentation and Scala Comple
Eric Kolotyluk wrote:
> Done!
>
> Thanks for workflow. Hopefully I followed your instructions correctly. If
> so I'll make some more attempts to improve the documentation as I encounter
> them.
You're welcome, and thanks for helping improve the documentation.
I sometimes have the same issue, where it takes me a bit to figure out
the expected use case of a particular class/trait/whatever. Giving
concrete examples of usage is almost always really helpful.
On Tue, Nov 29, 2011 at 09:18:08AM +0100, Egon Nijns wrote:
> It would be nice if there was a link to this workflow on every page of the
> scaladoc. Something like "How to submit documentation improvements"
I don't know about putting it on every page, but I will try to add (or
update) a page about contributing documentation to the Scala wiki, both
in terms of workflow and maybe also a link to some info about Scaladoc.
In this case, I think there is already some material available (on
contributing, github, scaladoc, etc) but I think it is a bit too spread
out and hard to find at the moment.
Re: Example Issue with Scala API Documentation and Scala Comple
On 2011-11-29 6:04 AM, Erik Osheim wrote:
> Eric Kolotyluk wrote:
>> Done!
>>
>> Thanks for workflow. Hopefully I followed your instructions correctly. If
>> so I'll make some more attempts to improve the documentation as I encounter
>> them.
> You're welcome, and thanks for helping improve the documentation.
>
> I sometimes have the same issue, where it takes me a bit to figure out
> the expected use case of a particular class/trait/whatever. Giving
> concrete examples of usage is almost always really helpful.
>
> On Tue, Nov 29, 2011 at 09:18:08AM +0100, Egon Nijns wrote:
>> It would be nice if there was a link to this workflow on every page of the
>> scaladoc. Something like "How to submit documentation improvements"
> I don't know about putting it on every page, but I will try to add (or
> update) a page about contributing documentation to the Scala wiki, both
> in terms of workflow and maybe also a link to some info about Scaladoc.
I would be happy to review it (from a newbie perspective) for you.
Another place you could put the the "How to submit documentation
improvements" link would be int the search frame. It would not be on
every page but it would be always visible and it might attract more
people into contributing to more documentation improvements (which we
all agree is desirable).
>
> In this case, I think there is already some material available (on
> contributing, github, scaladoc, etc) but I think it is a bit too spread
> out and hard to find at the moment.
I definitely agree :-)
>