Author Topic: Newlisp embedded in FB  (Read 1663 times)

0 Members and 1 Guest are viewing this topic.

RobbeK

  • Guest
Newlisp embedded in FB
« on: May 12, 2015, 04:31:30 AM »
Hi all,

Next works :

---------------------------------

    Dim library As Any Ptr
    Dim Shared Newlisp As Function ( ByVal As String) As ZString Ptr

    library = DyLibLoad( "newlisp" )
 

    Newlisp = DyLibSymbol( library, "newlispEvalStr" )
 

    Dim Shared As String lisp_input, lisp_output  , header
    Dim Shared As ZString Ptr result
    Dim Shared As String crlf                            ' for textbox
    crlf = Chr(13) & Chr(10)
   
    lisp_input = "    (define (fib x) " &_
         "     (let ((r '(1L 1L)))   " &_
         "      (dotimes (i x)     " &_
         "       (setq r (list (r 1) (+ (r 0) (r 1)))))    " &_
         "        (r 0) ))  "
 

 

   result = Newlisp(lisp_input)
   header = *result                             ' output in lambda form

---------------------------------------

best, Rob  (code attached)

.
« Last Edit: May 12, 2015, 04:39:49 AM by RobbeK »