Manual Notes 10.2.1

Started by Sammo, March 29, 2010, 09:57:27 AM

Previous topic - Next topic

johu

#15
I have some suggestion.



+, -, *, / ,%



For floating point values that evaluate to <tt>NaN</tt> (Not a Number),

both <tt>+INF</tt> and <tt>-INF</tt> are treated as <tt>0</tt> (zero).




Floating point values that evaluate to NaN is treated as <tt>0</tt> (zero),

and both <tt>+INF</tt> and <tt>-INF</tt> are treated as the maximum (<tt>9,223,372,036,854,775,807</tt>) integer values.




Because the misunderstanding may be carused.





case



The result of the last match is returned as the result for the entire case expression.

The result of the last expression in body is returned as the result for the entire case expression.



I think that "the last match" may cause a misunderstanding.





char



The empty string or a binary zero character return nil, but (char 0) will return "00".

The empty string return nil, but (char nil) will return "00".



Because (char "00") return 0 (zero).



Given an integer argument, char returns a string containing the ASCII character with value int.

Given an integer argument, char returns a string containing either the ASCII character with value int or the character escaped with a  (backslash) for a three-digit ASCII number.



It might be unnecessary.

Lutz

#16
Thanks Johu.



Note, that the integer conversion of -Inf will return the max negative integer starting 10.2.4 on Win32. On other OS, this was already the case.



There will be a new development release (source only) this weekend v.10.2.4.

johu

#17
clean

(with the list option).

(with the list mode).



from difference.





intersect

In the second syntax,

In the second syntax, intersect works in list mode.



from difference.





difine-macro



A third possibility is to refer to passed parameters using args:

A second possibility is to refer to passed parameters using args:



maybe.



<a href="#dolust">dolist</a> as a break condition

<a href="#dolist">dolist</a> as a break condition





delete



This mode can be used to delete namespace hashes and in object systems,

This mode can be used to delete namespace hashes in object systems,



maybe.



and bug ?


newLISP v.10.2.1 on Win32 IPv4, execute 'newlisp -h' for more info.

> (set 'lst '(a b aVar c d))
(a b aVar c d)
> (delete 'aVar true)
true
> lst
(a b nil c d)
>

also Linux-version.





det



If the matrix is singular and float-pivot is not specified nil is returned.

If the matrix is singular and float-pivot is not specified, nil is returned.



maybe.





device



int is an I/O device number,

int-handle is an I/O device number,

Lutz

#18
Thanks Johu, I will take care of this in the next development release.



ps: as of now back on US Eastern Time.

Kazimir Majorinc

#19
constant !



(constant sym-1 exp-1 [sym-2 exp-2 ... ]) => (constant sym-1 [exp1 [sym-2 [exp-2 ... ]]])



because (constant 'x), (constant 'x 1 'y), ...  are allowed ...



---
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

johu

#20
find

Find an expression in a list




If the first argument is a string, a regular expression option can be specified with int-regex-option and optionally an int-offset parameter.

If the first argument is a string, a regular expression option can be specified with int-regex-option parameter.



Because,


Quotesyntax: (find exp-key list [func-compare | int-regex-option])




first



In the second syntax,

In the third syntax,



Maybe.





format



 The w represents the width field. Data is right-aligned, except when preceded by a minus sign, in which case it is left-aligned. When preceded by a zero, the unused space is filled with leading zeroes. The width field is optional and serves all data types.



The p represents the precision number of decimals (floating point only) or strings and is separated from the width field by a period. Precision is optional. If preceded by a + (plus sign), positive numbers are displayed with a +. When using the precision field on strings, the number of characters displayed is limited to the number in p.





 The w represents the width field. Data is right-aligned, except when preceded by a minus sign, in which case it is left-aligned.  If preceded by a + (plus sign), positive numbers are displayed with a +. When preceded by a zero, the unused space is filled with leading zeroes. The width field is optional and serves all data types.



The p represents the precision number of decimals (floating point only) or strings and is separated from the width field by a period. Precision is optional. When using the precision field on strings, the number of characters displayed is limited to the number in p.

johu

#21
inf?



See also A to check is a floating point number is valid.

See also A to check if a floating point number is valid.





let



See also letn for an incremental or nested form of let.

See also letn for an incremental or nested form of let and local for initializing to nil.



Maybe, better ?





letex



This functions combines let and expand  to expand local variables into an expression before evaluating it.

This function combines let and expand  to expand local variables into an expression before evaluating it.



But, I saw sometimes "This functions" in other web sites.

This writing may be used commonly ?





map



Arguments missing in other argument lists cause an error message.

Arguments missing in other argument lists are assumed nil or the empty list ().



Becasue,
newLISP v.10.2.1 on Win32 IPv4, execute 'newlisp -h' for more info.

> (map (fn (x y z) (list $idx x y z)) '(a b c) '(1 2) '(A B C D E))
((0 a 1 A) (1 b 2 B) (2 c nil nil))
> (map list '(a b c) '(1 2) '(A B C D E))
((a 1 A) (b 2 B) (c))
>

Lutz

#22
Thanks Johu.

johu

#23
Last time, I made a mistake in inf?.



inf?

See also NaN?  to check is a floating point number is valid.

See also NaN?  to check if a floating point number is valid.





And, this time.



now



Am optional list-index in int-index makes now return a specific member in the result list.

An optional list-index in int-index makes now return a specific member in the result list.



The resolution of the microsecond field

depends on the operating system and platform.  On some platforms,

the last three digits of the <tt>microseconds</tt> field are always

<tt>0</tt> (zero).

The resolution of the <tt>microsecond</tt> field

depends on the operating system and platform.  On some platforms,

the last three digits of the <tt>microsecond</tt> field are always

<tt>0</tt> (zero).





parse-date



The function parse-date returns the number of seconds passed since January 1, 1900.

The function parse-date returns the number of seconds passed since January 1, 1970 from December 14, 1901 until January 19, 2038.



Because,
newLISP v.10.2.1 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info.

> (parse-date "2007.1.3" "%Y.%m.%d")
1167782400
> (parse-date "January 10, 07" "%B %d, %y")
1168387200
> (parse-date "1970.1.1" "%Y.%m.%d")
0
> (parse-date "1900.1.1" "%Y.%m.%d")
2085892096
> (parse-date "1901.12.13" "%Y.%m.%d")
2147408896
> (parse-date "1901.12.14" "%Y.%m.%d")
-2147472000
> (parse-date "2038.1.19" "%Y.%m.%d")
2147472000
> (parse-date "2038.1.20" "%Y.%m.%d")
-2147408896
>

Probably,

the function parse-date returns a signed 32-bit long number,

But the function date-value returns an unsigned 32-bit long number.

So, it can be used until February 6, 2106.


Quote> (date-value 2106 2 6)

4294944000

> (date-value 2106 2 7)

63104

>

Lutz

#24
Thanks Johu, changes are online in rev-15:



http://www.newlisp.org/downloads/newlisp_manual.html">http://www.newlisp.org/downloads/newlisp_manual.html

kanen

#25
In the manual;
Quotemember



syntax: (member exp list)

syntax: (member str str-key [num-option])


Shouldn't this be:


Quotesyntax: (member str-key str [num-option])


Because the format is actually;



(member "f" "a b c d e f")



Where "f" is the key to search for and "a b c d e f" is the string.



Or, does str-key mean something different in this case?
. Kanen Flowers http://kanen.me[/url] .

Lutz

#26
Thanks Kanen, the correction is online in rev. 16 of the manual:



http://www.newlisp.org/downloads/newlisp_manual.html">http://www.newlisp.org/downloads/newlisp_manual.html

xytroxon

#27
Contents

User Manual

...

15. Contexts

    * Symbol creation in contexts

    * Creating contexts ->  anchor not found



Change <a href="#scope_context">

To <a href="#creating_contexts">



=====================



Spelling:



acccesses - accesses

addtionally - additionally

comforms - conforms

datatype - data type

insteead - instead

notaion - notation

obkject - object

parameteri -parameter

parsig - parsing

pont - point



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Lutz

#28
Thanks Xytroxon, changes are onlinein rev. 17



http://www.newlisp.org/downloads/newlisp_manual.html">http://www.newlisp.org/downloads/newlisp_manual.html

johu

#29
write



If int-size is not specified, all data in sym-buffer or str-buffer is written.

If int-size is not specified, all data in str-buffer is written.



or



syntax: (write int-file str-buffer|sym-buffer [int-size])

syntax: (write str str-buffer|sym-buffer [int-size])





write-line



When the string argument is omitted write-line writes the contents of the last read-line to int-file

When the string argument is omitted write-line writes the contents of the last read-line to int-file.





Predefined variables and functions.



Two of them are used as namespace templates, one two write platform independent code.

Two of them are used as namespace templates, one to write platform independent code.



See the chapter Hash functions and dictionaries foe details.

See the chapter Hash functions and dictionaries for details.





By the way,

I finished to translate the section of Function Reference in newLISP User Manual into Japanese.



http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/.Public/newlisp%5E_manual-10201.zip">//http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/.Public/newlisp%5E_manual-10201.zip



This version is v.10.2.1 rev 17.