Author Topic: Lisp in Basic  (Read 208165 times)

0 Members and 1 Guest are viewing this topic.

JRS

  • Guest
Re: Lisp in Basic
« Reply #240 on: August 08, 2014, 04:30:30 PM »
Mike,

I think I added all the fixes you ask me to make. Can you look at the current Bitbucket source and tell me what is missing? Here is my test of loading a script from the command line and following it up with another load. I didn't get a file in use SB error.

Code: [Select]
jrs@laptop:~/sb/sb22/sblisp$ scriba lisp.sb Ave.scm
Initializing Memory...
Initializing Lisp Environment...
LISP in BASIC v1.3 by Arthur Nunes-Harwitt
(define average
  (lambda (input)
    (print (/ (apply + input) (length input))) (newline)
  )
)
AVERAGE
(average (list 0 1 2 3 4 5 6 7 8 9))
4.500000
T
0](load 'rectest.scm)
(define rectest (lambda (x)
(cond ((<= x (* 1000)) (print x) (print '_) (rectest (+ x 1))))
))
RECTEST
(rectest 1)
1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40_41_42_43_44_45_46_47_48_49_50_51_52_53_54_55_56_57_58_59_60_61_62_63_64_65_66_67_68_69_70_71_72_73_74_75_76_77_78_79_80_81_82_83_84_85_86_87_88_89_90_91_92_93_94_95_96_97_98_99_100_101_102_103_104_105_106_107_108_109_110_111_112_113_114_115_116_117_118_119_120_121_122_123_124_125_126_127_128_129_130_131_132_133_134_135_136_137_138_139_140_141_142_143_144_145_146_147_148_149_150_151_152_153_154_155_156_157_158_159_160_161_162_GC start GC done.
163_164_165_166_167_168_169_170_171_172_173_174_175_176_177_178_179_180_181_182_183_184_185_186_187_188_189_190_191_192_193_194_195_196_197_198_199_200_201_202_203_204_205_206_207_208_209_210_211_212_213_214_215_216_217_218_219_220_221_222_223_224_225_226_227_228_229_230_231_232_233_234_235_236_237_238_239_240_241_242_243_244_245_246_247_248_249_250_251_252_253_254_255_256_257_258_259_260_261_262_263_264_265_266_267_268_269_270_271_272_273_274_275_276_277_278_279_280_281_282_283_284_285_286_287_288_289_290_291_292_293_294_295_296_297_298_299_300_301_302_303_304_305_306_307_308_309_310_311_312_313_314_315_316_317_318_319_320_321_322_323_324_325_326_327_328_329_330_GC start GC done.
331_332_333_334_335_336_337_338_339_340_341_342_343_344_345_346_347_348_349_350_351_352_353_354_355_356_357_358_359_360_361_362_363_364_365_366_367_368_369_370_371_372_373_374_375_376_377_378_379_380_381_382_383_384_385_386_387_388_389_390_391_392_393_394_395_396_397_398_399_400_401_402_403_404_405_406_407_408_409_410_411_412_413_414_415_416_417_418_419_420_421_422_423_424_425_426_427_428_429_430_431_432_433_434_435_436_437_438_439_440_441_442_443_444_445_446_447_448_449_450_451_452_453_454_455_456_457_458_459_460_461_462_463_464_465_466_467_468_469_470_471_472_473_474_475_476_477_478_479_480_481_482_483_484_485_486_487_488_489_490_491_492_493_494_495_496_497_498_499_GC start GC done.
500_501_502_503_504_505_506_507_508_509_510_511_512_513_514_515_516_517_518_519_520_521_522_523_524_525_526_527_528_529_530_531_532_533_534_535_536_537_538_539_540_541_542_543_544_545_546_547_548_549_550_551_552_553_554_555_556_557_558_559_560_561_562_563_564_565_566_567_568_569_570_571_572_573_574_575_576_577_578_579_580_581_582_583_584_585_586_587_588_589_590_591_592_593_594_595_596_597_598_599_600_601_602_603_604_605_606_607_608_609_610_611_612_613_614_615_616_617_618_619_620_621_622_623_624_625_626_627_628_629_630_631_632_633_634_635_636_637_638_639_640_641_642_643_644_645_646_647_648_649_650_651_652_653_654_655_656_657_658_659_660_661_662_663_664_665_666_667_GC start GC done.
668_669_670_671_672_673_674_675_676_677_678_679_680_681_682_683_684_685_686_687_688_689_690_691_692_693_694_695_696_697_698_699_700_701_702_703_704_705_706_707_708_709_710_711_712_713_714_715_716_717_718_719_720_721_722_723_724_725_726_727_728_729_730_731_732_733_734_735_736_737_738_739_740_741_742_743_744_745_746_747_748_749_750_751_752_753_754_755_756_757_758_759_760_761_762_763_764_765_766_767_768_769_770_771_772_773_774_775_776_777_778_779_780_781_782_783_784_785_786_787_788_789_790_791_792_793_794_795_796_797_798_799_800_801_802_803_804_805_806_807_808_809_810_811_812_813_814_815_816_817_818_819_820_821_822_823_824_825_826_827_828_829_830_831_832_833_834_835_836_GC start GC done.
837_838_839_840_841_842_843_844_845_846_847_848_849_850_851_852_853_854_855_856_857_858_859_860_861_862_863_864_865_866_867_868_869_870_871_872_873_874_875_876_877_878_879_880_881_882_883_884_885_886_887_888_889_890_891_892_893_894_895_896_897_898_899_900_901_902_903_904_905_906_907_908_909_910_911_912_913_914_915_916_917_918_919_920_921_922_923_924_925_926_927_928_929_930_931_932_933_934_935_936_937_938_939_940_941_942_943_944_945_946_947_948_949_950_951_952_953_954_955_956_957_958_959_960_961_962_963_964_965_966_967_968_969_970_971_972_973_974_975_976_977_978_979_980_981_982_983_984_985_986_987_988_989_990_991_992_993_994_995_996_997_998_999_1000_()
0]

Lets sync up and I will only post what you send me until we get through these series of bugs.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #241 on: August 08, 2014, 04:47:13 PM »
OK John.

Let's plan it this way:

1. I'm downloading a copy of the repo.
2. I'm compare-merging it with my latest submission if there's anything to merge at all.
3. I'm uploading my merger here.
4. You're overwriting my HandleInternalError: with your HandleInternalError: that I posted for you as a code snippet here.
5. You're adding a line to include SB's standard errors.bas include to your script.
6. You're loading Ave.scm and running it.
7. Without exiting from LISP, you type in (average '(0 1 2 3 4 5 6 7 8 9)) at the LISP prompt and hit Enter, then repeat it at least 2 more times not quitting LISP to see that it doesn't throw an SB exception.
8. You're posting your findings as per Item 7 above here.
9. We're taking a decision on whether to upload your resultant lisp.sb to the repo as its final version.

Is that OK with you?


JRS

  • Guest
Re: Lisp in Basic
« Reply #242 on: August 08, 2014, 04:50:06 PM »
Works for me.


Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #243 on: August 08, 2014, 04:51:26 PM »
OK then ready, steady, go...

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #244 on: August 08, 2014, 05:07:35 PM »
Hehe John,

I appreciated and preserved your command line attraction intact. :)

Here comes the release candidate. Please proceed as per Item 4 of our plan.

.

JRS

  • Guest
Re: Lisp in Basic
« Reply #245 on: August 08, 2014, 05:19:28 PM »
Quote
8. You're posting your findings as per Item 7 above here.

Code: [Select]
jrs@laptop:~/sb/sb22/sblisp$ scriba lisp.sb Ave.scm
Initializing Memory...
Initializing Lisp Environment...
LISP in BASIC v1.3 by Arthur Nunes-Harwitt
(define average
  (lambda (input)
    (print (/ (apply + input) (length input))) (newline)
  )
)
AVERAGE
(average (list 0 1 2 3 4 5 6 7 8 9))
4.500000
T
0](average '(0 1 2 3 4 5 6 7 8 9))
4.500000
T
0](average '(0 1 2 3 4 5 6 7 8 9))
4.500000
T
0](average '(0 1 2 3 4 5 6 7 8 9))
4.500000
T
0](average '(0 1 2 3 4 5 6 7 8 9))
4.500000
T
0]


.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #246 on: August 08, 2014, 05:30:42 PM »
Cool, thanks! It worked!

Thanks for the include too. Not sure if I can use it tho. My scriba.exe wasn't fully set up; it was just a manual copy of the executable. IIRC I can't write an ASCII config - it should be precompiled as a binary file by the installer, shouldn't it?

Now I think your RC may go to the repository. We've done quite a piece of work. The / and - bugs may wait till tomorrow. :)

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #247 on: August 08, 2014, 05:40:31 PM »
Where are the flowers, champagne and heavenly music? I have become a Hero Member on this forum just like Aurel. And I guess by somewhat similar criteria.

8)

JRS

  • Guest
Re: Lisp in Basic
« Reply #248 on: August 08, 2014, 05:45:53 PM »
Quote
Not sure if I can use it tho. My scriba.exe wasn't fully set up;

error.bas is an include only and doesn't try to load any extension modules. Just put it in the same directory as lisp.sb and put quotes around the file name after IMPORT.

Quote
Where are the flowers, champagne and heavenly music? I have become a Hero Member on this forum ...

Hell, I would give you a hug if I could.  ;D

Does this mean I can post this to Bitbucket?

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #249 on: August 08, 2014, 05:57:34 PM »
!!! COOL !!! The include file and the script work for me too!

The other SB errors aren't affected. Just try to (load 'a-non-existent-file) and you'll get an ordinary SB exception while this very bug with an improper file number is totally suppressed.

Yes John, I think this lisp.sb can now go to Bitbucket. We'll look into the / and - bugs tomorrow. Thanks for co-operation!

JRS

  • Guest
Re: Lisp in Basic
« Reply #250 on: August 08, 2014, 06:33:31 PM »
I regenerated a new error.bas from current Script BASIC v2.2 source if you want to replace what you have with this. (may be the same ?) I will include error.bas in the Bitbucket repository.


.

JRS

  • Guest
Re: Lisp in Basic
« Reply #251 on: August 08, 2014, 07:12:05 PM »
I added additional contributor / repo location info about SBLisp to the header of the code. I would like to display SBLisp version .## or something like that and remove the old QB version startup.


JRS

  • Guest
Re: Lisp in Basic
« Reply #252 on: August 08, 2014, 07:46:18 PM »
If this project holds your interest, we could use Charles's DLLC to multi-thread SBLisp and use it to load Dave IDE/Debugger as a COM control. The Script BASIC MT extension module could be used to share (lockable RW) variables between threads.

Mike Lobanovsky

  • Guest
Re: Lisp in Basic
« Reply #253 on: August 08, 2014, 07:59:19 PM »
Thanks for the new error.bas. It is actually identical to the old one except for the version line.

I would like to display SBLisp version .## or something like that ...

You may place your own copyright blurb at the very top of the file and propagate the older credits further down the page. You may follow it with the code line to display the current SBLisp version as you say.

Quote
and remove the old QB version startup.

You may do it freely. But you may not remove the older blurb (credits to previous contributors) from the script altogether. This code is not in the public domain and it must preserve all the credits it has acquired throughout its lifetime. The older ones go down the page while the newer ones are being added at the top. This is what your GNU GPL law teaches you to do. ;)

Quote
If this project holds your interest...
At the current complexity of the source code and with a usable error.bas include, I can manage in a simple Notepad and an incremental debugger isn't really necessary for me (I think...)


G'night! :)

JRS

  • Guest
Re: Lisp in Basic
« Reply #254 on: August 08, 2014, 08:04:56 PM »
This is what is currently on Bitbucket.

Code: [Select]
' This work is licensed under the Creative Commons
' Attribution-NonCommercial-ShareAlike License. To view a copy of this
' license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or
' send a letter to Creative Commons, 171 Second St, Suite 300
' San Francisco, CA 94105, USA.

' The original author of this code is Arthur Nunes-Harwitt
' SBLisp version by John Spikowski and Mike Lobanovsky - Aug. 8th, 2014
' Bitbucket Repository: https://bitbucket.org/ScriptBasic/sblisp

I agree the above must remain intact but doesn't need to show at startup especially since  we are in essence creating a derivative.  I just don't see the need for it to be displayed every time at startup. If it was a compiled program that would be different.