Author Topic: Lisp in Basic  (Read 208169 times)

0 Members and 3 Guests are viewing this topic.

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #825 on: September 21, 2014, 12:40:06 PM »
Hi Mike,

There's no (unsilence)  .. the silence ends at the first hit of "Enter" key ..    (display )  etc ... act as normal.

Aha! So it constructs a list with values in the range of 1 to 22!

yep, and with the previous "pattern matching" algorithm I wrote , it is possible (very easy) to define : (...   L limit) -> S

(...  '(1 2 3) 20) generating (1 2 3 4 ...  20)
(...  '(2 4 6) 20) generating (2 4 6 8 ...  20)
(...  '(1 4 9) 20) generating (1 4 9 16)

etc...
Reinventing the wheel -- it's standard built in Haskell   :-[

best Rob   
 

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #826 on: September 21, 2014, 01:42:23 PM »
Rob,

Would you disagree if I add (mute <expression1> . . .) to OxyLISP's vocabulary? Not as a macro but as a basic keyword? (errors would be displayed as usual)

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #827 on: September 21, 2014, 04:07:37 PM »
Charles,

How would you describe, "compliment"-wise, what Oxygen's NOT is doing with a fractional floating point number?

Charles Pegge

  • Guest
Re: Lisp in Basic
« Reply #828 on: September 21, 2014, 04:52:59 PM »
Mike,

NOT will negate the number then subtract 1.

This is logically correct when converted to an integer, but is not the actual compliment of the binary representation of a float.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #829 on: September 21, 2014, 05:17:16 PM »
Thanks, Charles.

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #830 on: September 21, 2014, 11:05:03 PM »
Hi Mike,

Would be great , possibly

(mute

  (define ..........; )
  (define ......  )
 .
 .
 ;;  etc 

)

working with blocks could be a more general construction ??

Another speedy prog , I'm thinking about a more universal solution.  This one finds all 3² magic squares (written in NewLISP)

best, Rob




.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #831 on: September 22, 2014, 11:38:51 PM »
Thanks Rob! :)

OxyLISP doesn't support macros or syntax rules but only (define)'s.

In order to bypass this restriction to some extent and be able to create (for now hardcode only!) new "encompassing" syntactic forms which weren't available in Arthur's original Lisp-in-Basic, such as

(mute <expression1> . . . )

(when <test> <expression1> . . . )

(unless <test> <expression1> . . . )

(do ((<variable1> <init1> <step1>)  . . . )
    (<test> <expression> . . . )
    <command> . . . )


and others that can't be expressed in terms of simple (define)'s and (lambda)'s, I had to re-write practically all GOTO's in the sources to GOSUB/RET's. That would be equivalent to full blown SUB/END SUB's without arguments, and it would make interpreted SBLisp and FBLisp run yet at least 1.5 times slower than before, slow as they are now.

But OxyLISP's assembly call/ret's (equivalent to GOSUB/RET's) that replaced jmp's (former GOTO's) are indeed so fast that I'm not seeing any detectable speed deterioration due to such changes. This makes me very enthusiastic about the expandability of OxyLISP's vocabulary even though it can be achieved only by hardcoding rather than macros when defines and lambdas are insufficient.


P.S. Are (first) and (rest) simple aliases to (car) and (cdr)?

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #832 on: September 23, 2014, 07:48:16 AM »
Good news  (again) !

Macro definitions are extremely powerful in Lisp -- a macro definition of (define ...  )

(defmacro define (name params &rest body)
‘(progn
       (setf (symbol-function ’,name)
       #’(lambda ,params
               (block ,name ,@body)))
        ’,name))

-----------------------
but, I decided -- the combination of NewLISP and Oxygen , or a modern Scheme as BigLoo seem more suitable to me than the Common Lisps around.   (and I'll keep the "brutal" STALIN optimizer too). 
yep, a combination like NewLISP and Oxygen is fine : Lisp for the abstractions, and O² for speed   -- the FFI of NewLISP is great and NL does big ints ,  the macro's are somewhat easier to write than in CL ...  ok , decided  8)

yes, (first ) and (rest ) are the same as (car ) and (cdr ) ,  it are the original names
as can be seen on this document from McCarthy end 1950s

http://farm9.staticflickr.com/8232/8435395097_3b717701ec_z.jpg


best, Rob

JRS

  • Guest
Re: Lisp in Basic
« Reply #833 on: September 23, 2014, 08:01:49 AM »
Hi Rob,

OT - Did you ever give CERN ROOT for Windows a try? It seems a lot of the work you put into presentation is simplified with ROOT. The interpretive C and high level graphics API seems appealing. Compiling your projects to C is also cool. I'm not a MATH pro so ROOT is overkill for my needs.


RobbeK

  • Guest
Re: Lisp in Basic
« Reply #834 on: September 23, 2014, 12:30:27 PM »
Hi John,

Never tried it  :-\

But did play with DISLIN a few times :
from :  http://www.mps.mpg.de/en

(specific : http://www.mps.mpg.de/dislin/ )
-- there are/were? bindings for FreeBasic (Win/Linux) ---

no, what I do not like about CL this moment, is that I'm just collecting dependencies instead of effective code --- it's near the  Babel's confusion of tongues  (despite Quicklisp and other things )

best Rob

p.s.   does this work on an alien computer (attached)
I'm not sure where NewLISP expects the dll
(it's a nicer presentation of the magic 3x3 squares (sum of the rows and columns has to be the same using the number 1 ... 3²)  -- finding the solutions out of the combinations of the 9 numbers takes no time at all
(presentation is done including delay loops -- NL is really fast for an interpreter )



 

.
« Last Edit: September 23, 2014, 12:40:19 PM by RobbeK »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #835 on: September 23, 2014, 01:35:03 PM »
This one looks nice!

A Windows DLL will always work if it is stored beside its parent EXE. No need to ponder over where else to install it to.

JRS

  • Guest
Re: Lisp in Basic
« Reply #836 on: September 24, 2014, 01:09:25 AM »
Quote
But did play with DISLIN a few times

Be forewarned that if you try to use DISLIN=/usr as your install path, you will trash your Linux install.  :'(

Rebuilding my Linux system isn't going to be fun. Luckily I didn't lose anything and have a spare Linux laptop to get me through it.


Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #837 on: September 24, 2014, 12:07:44 PM »
Hi John,

Could I ask you to send an e-mail to Mr Arthur Nunes-Harwitt and ask him, on my behalf, for his kind permission to for me to decompose his LISP-in-BASIC .PDF file and add my minute corrections and description of the new language features? I'm currently working to add R5RS style Scheme macro system to the language, quasiquotes and stuff included.

Thanks!

JRS

  • Guest
Re: Lisp in Basic
« Reply #838 on: September 25, 2014, 01:45:04 AM »
Hi Rob,

Just getting back online with my development laptop after the Dislin disaster. (Rebuild of my Linux system)

A silver lining was I upgraded to 14.04.1 LTS and cleaned a lot a crap off my disk that now resides on my 5TB USB drive.

With this version of Ubuntu it comes with LibreOffice Math. (see attached) You should give it a try and see if it blows up your box.  :)

.

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #839 on: September 25, 2014, 12:54:04 PM »
Hi John,

Sorry to hear DISLIN torpedoing your Linux distro --  (I used it with FB under Windows -- only  for a short while ).

..  but, my heart is low for the moment , decided to work with NewLISP for future projects , and reading some comments and critiques , i found next :

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

I’ve been working in Lisp for 30 years now and after reading the manual for newLISP my feelings are that Lutz Mueller never understood what it is in Lisp that makes it still the most powerful programming language around. What he created is far far closer to scheme than to a modern Lisp. I wish he had called it newSCHEME so that people don’t get a bad impression of Lisp from newLISP.

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

After 30 years -- doesn't  (s)he know Scheme is a daughter of "Mother Lisp" --
Scheme is even older than Common Lisp --- 

...  what a nonsense ........   I mean, especially after 30! years ...  (sometimes i do not like the "world wide web" at all)

best Rob

LibreOffice Math  :)   , nice , I'll use it