Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Discrimination of Forth versus perl

Reply
Thread Tools

Discrimination of Forth versus perl

 
 
Albert van der Horst
Guest
Posts: n/a
 
      04-26-2005
I am trying to do some web scripting in Forth
This is a transcript of the perl
example from O'Reilly (Gundavaram) CGI-programming pg. 17.

With the multiple line strings and the occasional
auxiliary word, it looks neater than perl IMO.

However, no environment variables can be accessed from the
script apparently. The corresponding perl script has no
such problems. (Environment available in an associative
array %ENV ).
What is going on here?

[For those unacqainted with CGI, these are scripts that
generates html "on the file". With variable content.]


---------8<----------------8<--------------
#!/usr/bin/lina -s

\ Using server site scripting in Forth.

\ ---------- requisites -----------------
REQUIRE GET-ENV
\ Print environment variable from its NAME.
: .ENV GET-ENV TYPE "<BR>" TYPE CR ;

\ --------- push the scripts prelude --------------
"Content-type: text/html

<HTML>
<HEAD><TITLE> About this server</TITLE></HEAD>
<BODY>
<H1>About this server</H1>
<HR>Welcome to Albert's brave new world of Forth scripting!<HR>
<PRE>
" TYPE

\ --------- push information ---------------------
"Server Name: " TYPE "SERVER_NAME" .ENV
"Running on port: " TYPE "SERVER_PORT" .ENV
"Server SOFTWARE: " TYPE "SERVER_SOFTWARE" .ENV
"Server PROTOCOL: " TYPE "SERVER_PROTOCOL" .ENV
"CGI Revision: " TYPE "GATEWAY_INTERFACE" .ENV
"Server Name: " TYPE "SERVER_NAME" .ENV
"PATH Name: " TYPE "PATH" .ENV

\ --------- push the scripts postlude --------------
"</PRE>
</BODY>
</HTML>
" TYPE
---------8<----------------8<--------------
--
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
http://www.velocityreviews.com/forums/(E-Mail Removed)4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
 
Reply With Quote
 
 
 
 
Albert van der Horst
Guest
Posts: n/a
 
      04-26-2005
In article <(E-Mail Removed)4all.nl>,
Albert van der Horst <(E-Mail Removed)4all.nl> wrote:
>I am trying to do some web scripting in Forth
>This is a transcript of the perl
>example from O'Reilly (Gundavaram) CGI-programming pg. 17.
>
>With the multiple line strings and the occasional
>auxiliary word, it looks neater than perl IMO.
>
>However, no environment variables can be accessed from the
>script apparently. The corresponding perl script has no
>such problems. (Environment available in an associative
>array %ENV ).
>What is going on here?


I goofed. Apparently the implementation of ENV is broken.

With a redefinition of ENV (a ciforth specific dirty
hot patch) the script works:

\ Mysterious hot patch of ENV
: ENV' OLD: ENV 2 CELLS + ;
'ENV' 'ENV 3 CELLS MOVE

No discrimination agains Forth here.

<Script SNIPPED, see previous post>

Groetjes Albert

--
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
(E-Mail Removed)4all.nl http://home.hccnet.nl/a.w.m.van.der.horst
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positive discrimination. DanP Digital Photography 16 10-24-2012 03:52 PM
Re: Mozilla versus IE versus Opera versus Safari Peter Potamus the Purple Hippo Firefox 0 05-08-2008 12:56 PM
B&H settles discrimination suit, agrees to pay $4.3 million =?iso-8859-1?Q?Rita_=C4_Berkowitz?= Digital Photography 82 10-27-2007 10:43 PM
Standard Forth versus Python: a case study John Doty Python 42 10-16-2006 09:11 PM
Re: Forth versus C -- and Java Reply7471859353@wmconnect.com Java 0 03-20-2005 04:17 PM



Advertisments