RFC open on newLISP documentation

Started by kazemori, November 28, 2003, 02:34:32 PM

Previous topic - Next topic

nigelbrown

#225
Hi Lutz,

The reasion I suggested _questionmark_ is that listp is a likely name for a user to choose for ther own defined predicate function (especilly if they have an oldLisp background) - I was looking for a substitution that was unlikely to result in a naming clash. For a shorter form how about list_qm etc? Or maybe list__p, ie double underscore, and a manual note that double underscore is best not used in user defined names?



Nigel

Lutz

#226
I understand, but think they would confuse even more if they chose a 'listp' as a function name, I think I will leave it with the p, it also would leave them the freedom, to do things like:

> (constant 'listp list?)
list? <97D0>
> (listp '(a s d f))
true
>

to redefine to the 'old' ways



Lutz

nigelbrown

#227
Fair comment. Having P is more standard.



Nigel

nigelbrown

#228
I would like to suggest the need for some clarifying text for the Bayesian Chain example. The example as worked requires the assumption that retesting events are statistically independent. For a worked example see the test paper Q4 parts g) and h)  http://math.usask.ca/~bickis/courses/stats246/as203.pdf">http://math.usask.ca/~bickis/courses/stats246/as203.pdf and the answer at http://math.usask.ca/~bickis/courses/stats246/as203.html">http://math.usask.ca/~bickis/courses/st ... as203.html">http://math.usask.ca/~bickis/courses/stats246/as203.html .



The confounding issue is that if there is something that makes the test positive in a person that is unrelated to the disease in question but that is always going to be there then retest results can't be meaningfully chained.



Maybe add qualifying lines to the example so it reads:<start-text>



example:

(bayes-query '(test-positive) Data true)

=> (0.3076923077 0.6923076923)



If the testing is modified so that any negative result is interpreted as a negative but a positive result is retested and considered a positive only if the retest is a positive, and assuming that the results of the test and retest are statistically independent we have:



(bayes-query '(test-positive test-positive) Data true)

=> (0.64 0.36)



(bayes-query '(test-positive test-positive test-positive) Data true)

=> (0.8767123288 0.1232876712)



The example shows that a person may have to be tested several times positive to be classified as sick with confidence.



Regarding the requirement of statistical independence, two tests would be nearly independent if the variation in test results were due to variation in the lab that was not related to the patient. However, they would not be independent if there was variation among patients as to how readily the disease could be diagnosed. So if, for example, the test involved measuring some enzyme in the blood, then independence between retests would be expected if the lab quantitation was imprecise. Independence would not be expected if some other blood component unrelated to the disease was present in some individuals and this component interfered with the measurement of the enzyme.



<end-text>

The last paragraph is a straight copy from the exam answers mentioned above - if you were generally happy with the tone of the suggested wording then I could rework the lifted section or seek permission (although technically it is possibly too small a part of the whole to be a copyright violation that would be the 'right thing to do')

I will also use the working as set out in the web reference to check the results.



Nigel



PS another way of explaining the issue is here http://www.merck.com/mrkshared/mmanual/section21/chapter295/295e.jsp">http://www.merck.com/mrkshared/mmanual/ ... 5/295e.jsp">http://www.merck.com/mrkshared/mmanual/section21/chapter295/295e.jsp  



viz

the results of the various tests are often assumed to be conditionally independent (ie, the likelihood of a given test result depends on the gold standard diagnosis alone rather than on the gold standard and results of the other test), and the performance characteristics of the second test can be conditioned only on the gold standard for diagnosis.

Ryon

#229
I think I've found a small error in the online Manual and Reference.



In 13. Dynamic and lexical scoping, the example
(define (print-vars)
    (print "X=" x " Y=" y " Z= " z "n")

is missing a closing parenthesis.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#230
Thanks Ryon, will be corrected,



Lutz

Ryon

#231
The next example seems to be a little off also:


(define (inc-symbol x y)
    (inc x))

(set 'y 200)
(inc-symbol 'y 123) => 246

y                   => 999   ; y is still 999


Not tryin' to pick on you today!
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#232
The more corrections, the better ;)



Lutz

newdep

#233
in 8.8.0 manual (webpage) the "Co" index points to 'cons instead of

'Command-line



http://www.newlisp.org/downloads/newlisp_manual.html#cons">http://www.newlisp.org/downloads/newlis ... .html#cons">http://www.newlisp.org/downloads/newlisp_manual.html#cons
-- (define? (Cornflakes))

Sammo

#234
May I offer a corrected entry for "real-path" in the manual?

-- Sam



<a NAME="real-path"></a>

<h2><font color="#DD0000">real-path</font></h2>

syntax: (real-path [str-path])



<p>Returns the full path from a relative file path given in str-path.

If path is not given, <tt>"."</tt> (for the current directory) is assumed. </p>



example:





(real-path)                   => "/usr/home/fred" ;  current directory

(real-path "./somefile.txt")  => "/usr/home/fred/somefile.txt"







<p>The output length is limited by the OS's maximum allowed path length. If

<tt>real-path</tt> fails, e.g., because of a nonexistent path, <tt>nil</tt> is returned.</p>

Lutz

#235
Thanks Sam, for correcting this!



Lutz

HPW

#236
8.8.9 doc has 3 occurance of 'default functors' where it should be 'default function' (I think)
Hans-Peter

m i c h a e l

#237
Quote from: "Hans-Peter"8.8.9 doc has 3 occurance of 'default functors' where it should be 'default function' (I think)


I looked this up in Wikipedia, as I, too, was unsure whether "functors" was correct. My reading led me to believe that "functor" (i.e., a function object) is likely what Lutz is specifying here. We'll see what Lutz says.



m i c h a e l

m i c h a e l

#238
Quote from: "Hans-Peter"3 occurance of 'default functors' where it should be 'default function'


Just got to the part in the manual you reference and you're right. It should be default function and not default functor. I confused an earlier mention of 'functor' for your corrections. Thanks for pointing these out, Hans-Peter.



m i c h a e l

Lutz

#239
Both 'function' and 'functor' should be used. Some times the default form of 'foo' for 'foo:foo' is not used as a function but rather as a handle for a data object in those cases it is called the 'default functor'. Use 'default function' only when meaning an executable function. Use 'default functor' when referring to it as a data object.



Lutz