Finding hidden treasure (aka finding undocumented functions) [duplicate]

I was searching for a way to determine if a point is within a polygon and stumbled upon rm -rf's answer. (actually, I really wanted to find a point within a Rectangle, but I won't be picky.)

The use of an undocumented function left me wondering about other possible functions that might be fun to play with. A look at

?GraphicsMesh*


Comes up with a number of functions that don't look like they have documentation. There has been some discussion on how to find undocumented options, but I'm wondering how to find out usage for undocumented functions. For example, CurveToPolygon looks like it could be fun to play with but I have no idea what values to pass to it.

Information[GraphicsMeshCurveToPolygon]


Tells me something about the options and attributes, but if I try any of the following:

GraphicsMeshCurveToPolygon[
BezierCurve[{{-1, 0}, {-1, 2}, {1, 2}, {1, 0}}]]
GraphicsMeshCurveToPolygon[{{-1, 0}, {-1, 2}, {1, 2}, {1, 0}}]
GraphicsMeshCurveToPolygon[BezierCurve, {{-1, 0}, {-1, 2}, {1,
2}, {1, 0}}]
GraphicsMeshCurveToPolygon[{{-1, 0}, {-1, 2}, {1, 2}, {1,
0}}, BezierCurve]


The best I can learn is that the function takes 2 arguments.

I'm interested in knowing if there are ways to get at this information a priori or do I need to simply hang out with people who already know the answer?

Edit to address rm -rf comment I cut and pasted the code in Simon's answer into a new package, executed it, and when running:

Spelunk[GraphicsMeshCurveToPolygon]


I get the following output:

which is different from what I think is expected?

CurveToPolygon[Curve[data_], o : OptionsPattern[]] /; validPoly[data] ...?

• You don't really need to hang out with people. It's generally enough to chat with physicists, mathematicians, biologists, chemists and the such. OK, OK. I'll delete this comment at the first account suspension threat. Commented Sep 23, 2013 at 2:18
• @belisarius I don't know what that was, but I like the idea of threatening you with suspension... :D
– rm -rf
Commented Sep 23, 2013 at 2:21
• btw, I would consider this a duplicate of What is the most convenient way to read definitions of in-memory symbols when we don't have the source files?. Simon's answer there is fantastic, and all you need to look at the definition of CurveToPolygon. If you do that, you'll see that it only takes one argument (and options), which must have the head Curve.
– rm -rf
Commented Sep 23, 2013 at 2:25
• @belisarius it took me way too long to realize why I should be offended by that comment Commented Sep 23, 2013 at 11:25
• @bobthechemist You shouldn't. It was mostly a self-offense :) Commented Sep 23, 2013 at 11:29