Re: [racket-users] File Ports / Writing to a file

2016-04-20 Thread Matthias Felleisen

Now that is doubly weird: 

When I copy your expression to DrRacket and omit the #lang line, DrRacket warns 
me with 
a big fat red warning in the status line: 

 unsaved editor:3:0: Module Language: only a module expression is allowed, 
either #lang  
 or (module   ...)  in: (define out (open-output-file 
"some-file”))

When I run the program I get an even fatter warning: 

Welcome to DrRacket, version 6.5.0.3--2016-04-18(-/f) [3m].
Language: Determine language from source.
. Module Language: only a module expression is allowed, either
#lang 
 or
(module   ...)
 in: (define out (open-output-file "some-file"))

What version of DrRacket are you using that does not warn you? (We need to 
chase down the bug and fix it.) 




> On Apr 20, 2016, at 5:45 PM, George Mitwasi  wrote:
> 
> That did the trick. DrRacket didn't warn me and I've never needed #lang 
> racket before. The more you know. Thanks again.
> 
> - George
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] File Ports / Writing to a file

2016-04-20 Thread George Mitwasi
That did the trick. DrRacket didn't warn me and I've never needed #lang racket 
before. The more you know. Thanks again.

- George

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] File Ports / Writing to a file

2016-04-20 Thread Jon Zeppieri
On Wed, Apr 20, 2016 at 5:03 PM, George Mitwasi 
wrote:

> On Wednesday, April 20, 2016 at 3:09:53 PM UTC-4, Jon Zeppieri wrote:
> > Maybe you're using one of the teaching languages instead of Racket
> proper? In the "Language" menu, if you select "Choose Language..." you'll
> see a dialog. It should tell you what language you're using.
> >
>
> Interesting. The default language is set to "The Racket Language" which
> surprisingly doesn't work. I tested my code with the other languages and
> R5RS was the winner. Thanks you sir!
>
>

That is odd. The code should certainly work in the Racket language. (The
documentation you cited is for Racket.) Maybe you don't have a `#lang` line
in your definitions window? If you're writing in Racket, the first line of
your program should be:

#lang racket

or (if you want to start with a smaller language):

#lang racket/base

If you omit the #lang line, it won't work. However, DrRacket will actually
tell you that, so you're probably experiencing some different problem.
Unfortunately, I don't know what it is. I *do* know that the sample code
you posted should work in either racket or racket/base.

-Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] File Ports / Writing to a file

2016-04-20 Thread George Mitwasi
On Wednesday, April 20, 2016 at 3:09:53 PM UTC-4, Jon Zeppieri wrote:
> Maybe you're using one of the teaching languages instead of Racket proper? In 
> the "Language" menu, if you select "Choose Language..." you'll see a dialog. 
> It should tell you what language you're using.
> 
> 
> -Jon
> 
> 
> 
> 
> On Wed, Apr 20, 2016 at 3:05 PM, George Mitwasi  wrote:
> There's a good chance this is a quick fix and that I've overlooked something.
> 
> 
> 
> My goal is to simply write output to a text file directly from DrRacket. I've 
> read through the documentation 
> (https://docs.racket-lang.org/reference/file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29)
>  and am receiving errors with basic expressions like (define out 
> (open-output-file some-file)). Racket doesn't recognize the expression.
> 
> 
> 
> Am I missing a library (doesn't seem to be the case)? Are there some settings 
> that I need change?
> 
> 
> 
> Appreciate the help!
> 
> 
> 
> - George
> 
> 
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users...@googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

Interesting. The default language is set to "The Racket Language" which 
surprisingly doesn't work. I tested my code with the other languages and R5RS 
was the winner. Thanks you sir!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] File Ports / Writing to a file

2016-04-20 Thread Jon Zeppieri
Maybe you're using one of the teaching languages instead of Racket proper?
In the "Language" menu, if you select "Choose Language..." you'll see a
dialog. It should tell you what language you're using.

-Jon


On Wed, Apr 20, 2016 at 3:05 PM, George Mitwasi 
wrote:

> There's a good chance this is a quick fix and that I've overlooked
> something.
>
> My goal is to simply write output to a text file directly from DrRacket.
> I've read through the documentation (
> https://docs.racket-lang.org/reference/file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29)
> and am receiving errors with basic expressions like (define out
> (open-output-file some-file)). Racket doesn't recognize the expression.
>
> Am I missing a library (doesn't seem to be the case)? Are there some
> settings that I need change?
>
> Appreciate the help!
>
> - George
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] File Ports / Writing to a file

2016-04-20 Thread George Mitwasi
There's a good chance this is a quick fix and that I've overlooked something.

My goal is to simply write output to a text file directly from DrRacket. I've 
read through the documentation 
(https://docs.racket-lang.org/reference/file-ports.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._open-input-file%29%29)
 and am receiving errors with basic expressions like (define out 
(open-output-file some-file)). Racket doesn't recognize the expression.

Am I missing a library (doesn't seem to be the case)? Are there some settings 
that I need change?

Appreciate the help!

- George

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.