Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Is there anyway for scheme to see ' as a symbol
Reading from a text file...
I wrote a program to find an occurence of a string
in a text file, and I tested it on several text files, but Scheme has a
problem reading the ' character as a symbol.  Any suggestions?  The
program works great besides that... It took me AWHILE, but I finally got
it... Now if I could just get the bugs out... Are there any other
characters Scheme might not recognize as symbols that I should know about?



Report this thread to moderator Post Follow-up to this message
Old Post
audibel
11-01-04 08:56 AM


Re: Is there anyway for scheme to see ' as a symbol
audibel writes:

> Reading from a text file...
> I wrote a program to find an occurence of a string in a text file,
> and I tested it on several text files, but Scheme has a problem
> reading the ' character as a symbol.  Any suggestions?  The program
> works great besides that... It took me AWHILE, but I finally got
> it... Now if I could just get the bugs out... Are there any other
> characters Scheme might not recognize as symbols that I should know
> about?

You will have problems with all manner of lexical syntax if you read
with READ. READ is a parser. Characters include "',;() that certainly
occur in text, and also #`\ and probably [|]. Digits and and +-. put
you into number syntax and will cause problems.

Maybe you can preprocess the text so that problem cases are encoded
safely before you read them into Scheme. Better may be to write your
own reader and tokeniser; your implementation may provide at least
read-line to read a line as a string - it isn't hard to write - and
also tools to do things with strings.

You can, actually, turn ' into a symbol by (string->symbol "'") but I
suspect you would be better off working with strings.

Report this thread to moderator Post Follow-up to this message
Old Post
Jussi Piitulainen
11-01-04 01:56 PM


Re: Is there anyway for scheme to see ' as a symbol
I didn't even think about numbers, the example texts I used both were small
white lists of hyperlinks, so most of the data was in one continious
string, thanks.  My book uses read to read from a text file, so I thought
that would be the procedure to use.  I'll look for a read line procedurce,
if not I assume I'll have to use a read-char to make my own read line,
which shouldn't be too hard.

One thing I noticed about my program and PLT Scheme in general that I
didn't like.  I had Windows Task Manager (Yes, Computer Gods forgive me,
for right now I am using Windows) open and Plt Scheme is taking anywhere
from 50 - 80 megs of RAM???  The program binary for this little text grep
wannabe is sucking up about 7 megs of RAM???  Is that something I am doing
wrong in my code, or do Scheme programs usually suck system resources like
that?   This isn't a huge file, we're talking probably less than 50 lines
of code.



Report this thread to moderator Post Follow-up to this message
Old Post
audibel
11-02-04 01:57 AM


Re: Is there anyway for scheme to see ' as a symbol
"audibel" <audibel@sbcglobal.net> writes:

> One thing I noticed about my program and PLT Scheme in general that I
> didn't like.  I had Windows Task Manager (Yes, Computer Gods forgive me,
> for right now I am using Windows) open and Plt Scheme is taking anywhere
> from 50 - 80 megs of RAM???  The program binary for this little text grep
> wannabe is sucking up about 7 megs of RAM???  Is that something I am doing
> wrong in my code, or do Scheme programs usually suck system resources like
> that?

Are you saving it for something?  7 meg of physical RAM goes for about
a buck (SO-DIMM PC2100 DDR).  Virtual memory costs less.



Report this thread to moderator Post Follow-up to this message
Old Post
Joe Marshall
11-02-04 08:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:43 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.