- (val 'var) -> any
- Returns the current value of var. See alsosetq,setanddef.
: (setq L '(a b c))
-> (a b c)
: (val 'L)
-> (a b c)
: (val (cdr L))
-> b
 
- val/3
- Pilog predicate that returns the value of an
object's attribute. Typically used in database queries. The first argument is a
Pilog variable to bind the value, the second is the object, and the third and
following arguments are used to apply the getalgorithm to that object. See alsodb/3andselect/3.
: (?
   (db nr +Item (2 . 5) @Item)   # Fetch articles 2 through 5
   (val @Nm @Item nm)            # Get item description
   (val @Sup @Item sup nm) )     # and supplier's name
 @Item={B2} @Nm="Spare Part" @Sup="Seven Oaks Ltd."
 @Item={B3} @Nm="Auxiliary Construction" @Sup="Active Parts Inc."
 @Item={B4} @Nm="Enhancement Additive" @Sup="Seven Oaks Ltd."
 @Item={B5} @Nm="Metal Fittings" @Sup="Active Parts Inc."
-> NIL
 
- (var sym . any) -> any
- (var (sym . cls) . any) -> any
- Defines a class variable symwith the initial valueanyfor the current class, implicitly given by the value of the
global variable*Class, or - in the
second form - for the explicitly given class cls. See also OO Concepts,relandvar:.
: (class +A)
-> +A
: (var a . 1)
-> 1
: (var b . 2)
-> 2
: (show '+A)
+A NIL
   b 2
   a 1
-> +A
 
- (var: sym) -> any
- Fetches the value of a class variable symfor the current
objectThis, by searching the property
lists of its class(es) and superclasses. See also OO
Concepts,var,with,meta,:,=:and::.
: (class +A)
-> +A
: (var a . 1)
-> 1
: (var b . 2)
-> 2
: (object 'O '(+A) 'a 9 'b 8)
-> O
: (with 'O (list (: a) (: b) (var: a) (var: b)))
-> (9 8 1 2)
 
- (version ['flg]) -> lst
- Prints the current version as a string of dot-separated numbers, and returns
the current version as a list of numbers. The JVM- and C-versions print an
additional "JVM" or "C", respectively, separated by a space. When
flgis non-NIL, printing is suppressed. See also*CPUand*OS.
$ pil -version
15.11.0
: (version T)
-> (15 11 0)
 
- (vi 'sym) -> sym | NIL
- (vi 'sym 'cls) -> sym | NIL
- (vi 'lst) -> lst | NIL
- (v . lst) -> lst | NIL
- (Debug mode only) Opens the "Vip" editor on the function or method
definition of sym(source file or direct path name), or on a list
of symbolslst(in-memory). See alsodoc,*Dbg,debugandpp.
: (vi 'put> '+Entity)  # Edit the method's source code
: (v {1})  # In-memory-edit the database root object
-> put>
 
- (view 'lst ['T]) -> any
- Views lstas tree-structured ASCII graphics. When theTargument is given,lstshould be a binary tree
structure (as generated byidx), which
is then shown as a left-rotated tree. See alsoprettyandshow.
: (balance 'I '(a b c d e f g h i j k l m n o))
-> NIL
: I
-> (h (d (b (a) c) f (e) g) l (j (i) k) n (m) o)
: (view I)
+-- h
|
+---+-- d
|   |
|   +---+-- b
|   |   |
|   |   +---+-- a
|   |   |
|   |   +-- c
|   |
|   +-- f
|   |
|   +---+-- e
|   |
|   +-- g
|
+-- l
|
+---+-- j
|   |
|   +---+-- i
|   |
|   +-- k
|
+-- n
|
+---+-- m
|
+-- o
-> NIL
: (view I T)
         o
      n
         m
   l
         k
      j
         i
h
         g
      f
         e
   d
         c
      b
         a
-> NIL