Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Useless Needs (was: request-font)

From: rebol-list2::seznam::cz at: 18-Jan-2003 12:21

Hello Carl, Just one think.... using the Needs in the header is bad idea because it's simply stupid! I think that RT are lost in their own product version conventions. Rebol/Link (IOS version of Rebol which should be better then Rebol/View) should be good enough to run your script (get-fonts-windows.r) but with the Needs: [Rebol/View 1.2.1] is result: ** Script Error: This script needs 1.2.1 or better to function correctly ** Where: do-boot ** Near: do/args dir args return true
>> system/version
>> system/product
== Link
If it would be possible to use: Needs: [REBOL/View 1.2.1 Rebol/Link 1.0.6] It would be ok, but it's not possible! So... if you want to make sure that the script will be running on some Rebol/Product, you should write own testing as for example: ------- can-run?: does [ switch/default system/product [ View [system/version >= 1.2.1] Link [system/version >= 1.0.5] ][ false ] ] if not can-run? [ print "*** You have unsupported Rebol/Product!" print "*** The script may not be running properly!" ] ------- With such a way you may also fix some version dependent changes (for example to set/modify some functions to be able run the script under that version. .....and when I'm talking about the Rebol header and it's Needs value... I started to use Require to enter files which the script will use (this cannot be added to Needs value, just because the Needs testing is strange:) Cheers Oldes =( Oliva David )=======================( [oliva--david--seznam--cz] )== =( Earth/Europe/Czech_Republic/Brno )============================= =( coords: [lat: 49.22 long: 16.67] )=============================