Re: Anyone heard of Bee Lisp?



In article <hno5pt$lqo$1@xxxxxxxxxxxxxxxxxxxxxxxxxx>, refun@xxxxxxxxxxxxxx
says...

I was a bit bored, so I took a quick look at the documentation. Here is a
complete listing of all functions/special forms:
CAR/CDR/CONS - seems to work on lists instead of cons cells. The documentation
seems to allude that a list might not be built out of CONSes, but it's actually
an array of pointers to objects. Testing (CONS 1 2) in the REPL seems to
generate a list of 2 elements (1 and 2).
READ - seems to either read something from the console or from a string and
coerce it into a list.
QUOTE - Prevents evaluation of the parameter. Strangely, typing random things
which can't be evaluated at the REPL seems to just return them as if quoted..
EVAL - The usual meaning, evaluates an object/quoted list.
PRINT - Prints an object. Strings seem to come with some standard C-like escape
sequences (\n \r \t \\ \")
SETF - I'll quote from manual:
Sets value of object VAL to the value of object ID. If ID is identifier, then
function will search for the object with that name, going up through the stack
to higher addresses memory block, where global variables defined. If such an
object is found, its value will be changed to VAL. If such an object doesn?t
exist, then it will be created in local memory of current function. If ID is
list, then it will be evaluated, and assignment will be made to that evaluation
result.
LET - Misleading name. It's actually an assignment operator:
Sets value of object VAL to the value of object ID. If such an object is found
on the local stack frame, its value will be changed to VAL. If such an object
doesn?t exist, then it will be created in local memory of current function. If
ID is list, then it will be evaluated, and assignment will be made to that
evaluation result.
Example:
(LET myvar ?(3 4 5)) ; assign list to ?myvar? atom
(LET (CAR myvar) 5) ; replace the first element of ?myvar?
list to 5.
DEFUN/DEFBIN/DEFMACRO - Defines a global function, DEFBIN seems to define a
callback (arranges for the executable to have an export with that name that
calls the interpreter). DEFMACRO seems* to make the function inlined.
STRREAD - reads a string from the console
AND/OR - logical and/or, not short circuiting!
NOT - logical not
PLUS/MINUS/DIV/MUL - integer operations
LESS/MORE - comparsion functions
AREF - Returns nth character in a string or nth element in a list
LEN/LENGTH - List or string length
STRCAT - Concatenates strings.
LOOP - C while loop equivalent.
IDIV/IMUL/MOD - Unlike DIV and MUL, these only take 2 arguments.
MALLOC/FREE - Allocate/free a block of memory.
GETBYTE/GETWORD/GETDWORD/GETSTRING/SETBYTE/SETWORD/SETDWORD/SETSTRING -
read/write to logical memory of the application. Will work with any memory
pointer it seems, but I suspect they're meant to be used with malloc/free.
CALL - calls a pointer.
CALLAPI - Resolves and calls a Win32 API or DLL function.
S - Quote from documentation:
Converts A to string and forbids automatic type conversion for resulting
object.
Example:
(CALLAPI "MessageBoxA" "User32.dll" 0 "Hello World" "12" 0) ; error! 12 is passed as number
Solution:
(SETF str (S ?12?) )
(CALLAPI "MessageBoxA" "User32.dll" 0 "Hello World" str 0)

FREECONSOLE - "Detaches console from the process"
UNTYPED - "Cancels automatic type conversion for resulting object."
CHR - "Returns string, consisting of object A, which represents symbol ASCII
code"
ORD - "Returns ASCII code of first symbol of string S."
HEX - "Returns hexadecimal number represented by string S."
EXIT - Returns a value from a function.
EXITBLOCK - Returns from a block of code if the passed expression is true.
JMP - "Jumps to k-th function within current block and continue successive
execution."
JMPREL - "Jumps to k-th function relative to the current one within current
block and continue successive execution. Zero means next instruction."
CJMP/CJMPREL - Like JMP, but relative. The semantics of these functions are a
mystery to me.
$EVAL_ERROR$ - A global variable which contains the current evaluation error.
GET-PROGRAM-CODE - "Returns program code"
GET-PROGRAM-MEMORY - "Returns virtual machine memory (as object list)"

Other functions/special forms:
COND,EQ,EQUAL,ATOM,BOUNDP,ISSRING,ISNUMBER,ISINTEGER,BITWISE-AND/BITWISE-
OR/BITWISE-NOT/BITWISE-XOR

* - The documentation is not perfectly clear about the exact semantics of many
such forms, for example, the only line in the DEFMACRO's documentation is:
Defines marco and returns its body. Unlike function, macro body is inserted in
place of its call.
Example:
(DEFMACRO println (text)
(PRINT text)
(PRINT ?\n?)
)

This seems considerably more low-level than I expected.
.



Relevant Pages

  • Re: Very Basic LISP Question
    ... if I use a string for the list elements ... Some functions that operate on lists may have ... Those expectations should ... be documented as part of the function's documentation. ...
    (comp.lang.lisp)
  • a splitting headache
    ... All I wanted to do is split a binary number into two lists, ... reasons unknown. ... start or end the string in which case the first one is included. ... Would it have been that difficult to show in the documentation ...
    (comp.lang.python)
  • TOC of Python Cookbook now online (was Re: author index for Python Cookbook 2?)
    ... Processing a String One Character at a Time ... Finding a File on the Python Search Path ... Constructing Lists with List Comprehensions ... Looping over Items and Their Indices in a Sequence ...
    (comp.lang.python)
  • ANN: MeObjects Library for Delphi
    ... object type small and powerful. ... the Object instance can use the ClassType method return the ... Especially for lists of pointers to dynamically allocated memory. ... {Summary Adds Ansi String and correspondent object to a list. ...
    (borland.public.delphi.thirdpartytools.general)
  • Filling a grid with Sharepoint data
    ... /// Retrieves a Lists web service proxy with default settings. ... string strComputerName = System.Net.Dns.GetHostName.ToLower; ... XmlDocument xmlDoc, ... XmlElement elementMethod, ...
    (microsoft.public.dotnet.framework.windowsforms)