Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other

Alphabetic catalog of Language elements P

pair?

pair? recognizes a cons cell.

Category Primitive procedure
Format (pair? obj)
Parameters
objany object
Description pair? returns #t for a non-empty list (a cons-cell) and #f for any other object.
R4RS Compliance Full
Examples
(pair? '(a b c)) => #t
(pair? '()) => #f
(pair? 42) => #f

peek-char

peek-char returns the next character from an input port.

Category Native procedure
Format (peek-char inport)
Parameters
inportan input port
Description peek-char reads ahead the next character from the input port inport and returns it, but doesn't advance the input position. If the end of file is reached, a unique end-of-file object (which is recognized by eof-object?) is returned.
R4RS Compliance The port parameter is not optional.
Examples
(peek-char (open-input-file "foo")) => #\b, assuming the memo "foo" starts with
bar,123...

pen-down

pen-down is posted when the pen touches the screen.

Category UI event
Format (pen-down x y)
Parameters
xWindow-relative x coordinate in pixels
yWindow-relative y coordinate in pixels
Description pen-down is the first event posted when the user taps the screen with the pen. This event normally causes other events like lst-enter afterwards.

pen-move

pen-move is posted when the pen is moved on the screen.

Category UI event
Format (pen-move x y)
Parameters
xWindow-relative x coordinate in pixels
yWindow-relative y coordinate in pixels
Description pen-move is the event posted when the user moves the pen across the screen. Some kinds of UI element track pen movement by themselves, so you won't see this event.

pen-up

pen-up is posted when the pen is lifted from the screen.

Category UI event
Format (pen-up x y)
Parameters
xWindow-relative x coordinate in pixels
yWindow-relative y coordinate in pixels
Description pen-up is the event posted when the user lifts the pen from the screen. Some kinds of UI element track pen lifting by themselves, so you won't see this event.

pick-color

pick-color displays the system dialog for selecting a color.

Category Native procedure
Format (pick-color title col)
Parameters
titlea string being displayed as the dialog title
colcolor number, an integer in the range 0-255
Description pick-color dialog pick-color displays the system dialog to let the user select a color. The initial color selected is col. The index of the selected color is returned, or #f if the user canceled the dialog. On systems running older OS versions than 3.5, 0 is returned immediately without displaying a dialog.
R4RS Compliance LispMe extension
Examples
(pick-color "Select a color" 123) => 123 depending what the user selected.

pick-date

pick-date displays the system dialog for selecting a date.

Category Native procedure
Format (pick-date title date)
Parameters
titlea string being displayed as the dialog title
datethe initial date displayed
Description pick-date dialog pick-date displays the system dialog to let the user select a date. The initial date selected is date. The new date selected is returned as a date or #f if the user canceled the dialog.
R4RS Compliance LispMe extension
Examples
(pick-date "Select a date" (make-date 2001 3 17)) => [date 1. Apr 2001]

pick-time

pick-time displays the system dialog for selecting a time.

Category Native procedure
Format (pick-time title time)
Parameters
titlea string being displayed as the dialog title
timethe initial time displayed
Description pick-time dialog pick-time displays the system dialog to let the user select a time. The initial time selected is time. The new time selected is returned as a time value or #f if the user canceled the dialog.
R4RS Compliance LispMe extension
Examples
(pick-time "Select a time" (make-time 17 29)) => [time 11.11 am]

pick-time-range

pick-time-range displays the system dialog for selecting a time range.

Category Native procedure
Format (pick-time-range title time1 [time2])
Parameters
titlea string being displayed as the dialog title
time1the start time displayed
time2the end time displayed
Description pick-time-range dialog pick-time-range displays the system dialog to let the user select a time range. The initial start time selected is time1, the initial end time is time2 if specified, or the start time otherwise. The new time range selected is returned as a list of two time values or #f if the user canceled the dialog.
R4RS Compliance LispMe extension
Examples
(pick-time-range "Select range" (make-time 4 33)) => ([time 4:33 am] [time 3:15 pm])

pop-select

pop-select is posted when an item in a popup-list has been selected.

Category UI event
Format (pop-select pid lid newsel oldsel)
Parameters
pidthe form id of popup trigger
lidthe form id of the list
newselthe zero-based index of the selected item
oldselthe zero-based index of the previously selected item
Description pop-select is the event posted when the user has selected an item in a popup list.

port?

port? recognizes any port.

Category Library procedure
Format (port? obj)
Parameters
objany object
Description port? returns #t for an input port or an output port and #f for any other object.
R4RS Compliance Full
Examples
(port? (open-output-file "foo")) => #t
(port? (open-input-file "bar")) => #t
(port? "baz") => #f

position posv posq

position, posq, and posv return the position of an element in a list.

Category Native procedures
Formats
(position obj list)
(posq obj list)
(posv obj list)
Parameters
objany object
alista proper list
Description These procedures return the zero-based position of obj in list. If obj is not found, #f is returned. To compare obj with the list elements, position uses equal?, posq uses eq?, and posv uses eqv?.
R4RS Compliance LispMe extension
Examples
(position 'b '(a b c d)) => 1
(position 'c '(a b)) => #f
(posq '(b) '(a (b) c)) => #f
(position '(b) '(a (b) c)) => 1

positive?

positive? tests, if a number is positive.

Category Library procedure
Format (positive? num)
Parameters
numa number
Description positive? returns #t, if num is positive. Otherwise it returns #f. See also negative? and zero?.
R4RS Compliance Full
Examples
(positive? 42) => #t
(positive? 0) => #f

procedure?

procedure? recognizes procedures.

Category Primitive procedure
Format (procedure? obj)
Parameters
objany object
Description procedure? returns #t for a procedure and #f for any other object. Procedures include both closures returned by lambda and continuations created with call/cc
R4RS Compliance Full
Examples
(procedure? (lambda (x) x)) => #t
(call/cc procedure?) => #t
(procedure? 'foo) => #f

promise?

promise? recognizes promises.

Category Primitive procedure
Format (promise? obj)
Parameters
objany object
Description promise? returns #t for a promise returned by delay and #f for any other object. It doesn't matter, if the promise has already been forced.
R4RS Compliance Full
Examples
(promise? (lambda (x) x)) => #f
(call/cc promise?) => #f
(promise? (delay 5)) => #t
(promise? 5) => #f

pset!

pset! modifies several variables in parallel.

Category Special form (Compiler extension)
Format (pset! (var1 ... varn) expr1 ... exprn)
Parameters
varian identifier
exprian expression
Description pset! evaluates all expressions expri in an unspecified order and assigns the values to the corresponding variables vari. All variables vari must be bound (by define, lambda, let, or letrec), or an error results.

The variables are assigned after all expressions have been evaluated. Additionally, this instruction is faster than setting the variables sequentially. The return value is the value of the right-most expression.

R4RS Compliance LispMe extension
Examples
(let ((a 0) (b 42)) (pset! (a b) b a) (list a b)) => (42 0)

Back to index A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Other