Author Topic: Lisp in Basic  (Read 208061 times)

0 Members and 2 Guests are viewing this topic.

JRS

  • Guest
Re: Lisp in Basic
« Reply #90 on: August 03, 2014, 05:29:13 PM »
Charles,

Can you split this topic so we can get back to SBLisp and try to get it working?

Thanks!


Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #91 on: August 03, 2014, 05:44:18 PM »
This isn't an SB Lisp topic! And that's an Open Forum board BTW. :)

JRS

  • Guest
Re: Lisp in Basic
« Reply #92 on: August 03, 2014, 06:00:52 PM »
Okay. It's the SBLisp and FBSL Lisp thread.  :)

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #93 on: August 03, 2014, 06:22:13 PM »
No, actually the first submission was Charles' Lispish effort. :)

Don't you worry, John. I'm still f... er, ...ighting with the SB Lisp script exactly where I left off yesterday. The Toy interpreter couldn't resist for long and I'm positive SB Lisp won't either.

JRS

  • Guest
Re: Lisp in Basic
« Reply #94 on: August 03, 2014, 06:54:53 PM »
Thanks Mike!

I working on the last round of cleanup where I add spaces between operators and variables. It makes the code much easier to read.

If you can gather a list of fixes to SBLisp since your last release, I can merge them into the version I'm working on. (the one I sent you last night with another level of cleanup)

Keep in mind I'm on the #AllBASIC IRC if need to chat about this.

JRS

  • Guest
Re: Lisp in Basic
« Reply #95 on: August 03, 2014, 07:20:25 PM »
Mike,

Have you run any Lisp benchmarks with FBSL Lisp? I'm curious how it compares with other Lisp Scheme versions. I'm assuming you're running SB on Windows. I'm using the Ubuntu 64 bit version of SB. I also wonder how feature complete the Lisp interpreter is. I wonder if Rob can give your version a try?

« Last Edit: August 03, 2014, 07:27:36 PM by John »

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #96 on: August 03, 2014, 08:39:47 PM »
Hehe John,

No need for Rob to benchmark FBSL Lisp. He will be able to benchmark SB Lisp instead. Yes, I've killed that beast! :D

There is a deficiency in SB conditionals: it can't tolerate

Code: [Select]
IF INSTR("()'",CURCHAR) OR CURCHAR<=" " THEN
but rather only

Code: [Select]
IF INSTR("()'",CURCHAR)<>0 OR CURCHAR<=" " THEN
That's why both QB45 and FBSL swallowed the script while SB didn't.

Now you can rest in peace (meaning have a good rest ;) ) till tomorrow morning your time. I'm going to grab some sleep too. As soon as I'm awake, I'll clean up all my garbage and post the script here.



See you,

JRS

  • Guest
Re: Lisp in Basic
« Reply #97 on: August 03, 2014, 08:46:43 PM »
Great news Mike.

Keep in mind that SB INSTR() will return a undef not 0 if the match fails.

Quote from: SB Docs
This function can be used to search a sub-string in a string. The first argument is the string we are searching in. The second argument is the string that we actually want to find in the first argument. The third optional argument is the position where the search is to be started. If this argu-ment is missing the search starts with the first character position of the string. The function returns the position where the sub-string can be found in the first string. If the searched sub-string is not found in the string then the return value is undef.

Code: [Select]
p = 0

p = INSTR("ABC","Z")

PRINT p,"\n"

jrs@laptop:~/sb/sb22/sblisp$ scriba testinstr.sb
undef
jrs@laptop:~/sb/sb22/sblisp$
« Last Edit: August 03, 2014, 09:18:50 PM by John »

Aurel

  • Guest
Re: Lisp in Basic
« Reply #98 on: August 03, 2014, 08:59:22 PM »
Quote
Aurel,
naturlich und selbstverschtendlich = wrong
Natürlich und Selbstverständlich   = correct

yes Peter i know ,i don't have german keyboard   :-\

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #99 on: August 03, 2014, 09:18:46 PM »
Quote
Aurel,
naturlich und selbstverschtendlich = wrong
Natürlich und Selbstverständlich   = correct

yes Peter i know ,i don't have german keyboard   :-\

Hi Aurel,

Then IMHO it shoud have been "Natuerlich und Selbstverstaendlich".

Am I correct saying this, Peter?

JRS

  • Guest
Re: Lisp in Basic
« Reply #100 on: August 03, 2014, 11:02:12 PM »
I think I found a typo in the QBLisp program as well.

Code: [Select]
IF PTYPE<>NUMBER OR QTYPE<>NUMBER THEN
  PRINT "ERROR:IN >"
  GOTO HandleError
END IF 
IF PVALUENUMBER OR QTYPE<>NUMBER THEN
  PRINT "ERROR:IN <"
  GOTO HandleError
END IF

I think it should be PVALUE<>NUMBER as that is the only instance of PVALUENUMBER.

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #101 on: August 04, 2014, 02:16:41 AM »
Hi,

I can benchmark against NewLisp script and other interpreted/compiled Lisps if someone likes ....

As for German (attached)  ... in proper Teutonic style ...  (something called Sütterlin ...  )  -- who can read this ?!

Lisp : will be understandable if ...      (defmacro I() 'we )   8)

 

.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #102 on: August 04, 2014, 02:30:14 AM »
Hi Rob,

Need time to read and understand your message: I never thought "e" can be printed as "n" in Gothic! :D

Now urgent: please tell me what (floor -1.6) should return in Lisp?

P.S. So far I got as far as "An meinen Freunden Aurel und Mike : natuerlich und selbverstaendlich ! Uebung macht den Meister !! Rob" (To my friends Aurel and Mike: naturally and evidently! Practice makes one a master!! Rob) :D
« Last Edit: August 04, 2014, 03:01:41 AM by Mike Lobanovsky »

RobbeK

  • Guest
Re: Lisp in Basic
« Reply #103 on: August 04, 2014, 02:35:33 AM »
multiple value :

-2
0.399999999999    (<- this value only intercepted by (multiple-value-list  (floor  ....  ))   otherwise it "vanishes" )

best , Rob

Peter

  • Guest
Re: Lisp in Basic
« Reply #104 on: August 04, 2014, 02:38:45 AM »
Quote
Am I correct saying this, Peter?

Yes, that's correct Mike.

Rob translating:

An meinen Freunden Aurel und Mike,
Natürlich und Selbverständlich!

Übung macht den Meister.
Rob

Rob wrote:
To my friends Aurel and Mike,
of course and naturally.

Practice makes perfect!
Rob

Notice: "An meinen Freunden Aurel und Mike" is incorrect,  "An Mein Freund Aurel und Mike"  is correct 
             An Meine Freunde !                                                           
« Last Edit: August 04, 2014, 05:52:46 AM by Peter »