Re: [racket] Can I refer a member variable of a structure instance as a reference?

2010-06-24 Thread Insik Cho
It works well. Thanks! - Joe On Thu, Jun 24, 2010 at 5:24 PM, Jon Rafkind wrote: > #lang racket > > (define-struct foo (x y) #:mutable) > (define foo-instance (make-foo 1 2)) > (set-foo-x! foo-instance 5) > (foo-x foo-instance) > > > On 06/24/2010 06:09 PM, Insik Cho wrote: > > Hi buddies, > >

Re: [racket] Can I refer a member variable of a structure instance as a reference?

2010-06-24 Thread Jon Rafkind
#lang racket (define-struct foo (x y) #:mutable) (define foo-instance (make-foo 1 2)) (set-foo-x! foo-instance 5) (foo-x foo-instance) On 06/24/2010 06:09 PM, Insik Cho wrote: Hi buddies, When I make an instance of a structure, I want to modify of the value of members of the instance. So, can

Re: [racket] Can I refer a member variable of a structure instance as a reference?

2010-06-24 Thread Jay McCarthy
I have a very hard time parsing this question but you may be interested in using struct-copy. Jay On Thu, Jun 24, 2010 at 6:09 PM, Insik Cho wrote: > Hi buddies, > When I make an instance of a structure, I want to modify of the value of > members of the instance. > So, can I refer a member of a

[racket] Can I refer a member variable of a structure instance as a reference?

2010-06-24 Thread Insik Cho
Hi buddies, When I make an instance of a structure, I want to modify of the value of members of the instance. So, can I refer a member of a structure as a referent to update it directly? - Joe _ For list-related administrative tasks: http://lis

Re: [racket] tennis and programming, not completely off-topic

2010-06-24 Thread Neil Van Dyke
Barry Brown wrote at 06/24/2010 02:54 PM: My question is: why were there IBM programmers at the match? They might've been systems engineers. Or system operators. I would guess that standard operating procedure was that they be there, ostensibly to make sure the systems work for the big event

Re: [racket] tennis and programming, not completely off-topic

2010-06-24 Thread Barry Brown
Here's a link to a NY Times blog entry about the match in question: http://straightsets.blogs.nytimes.com/2010/06/23/logistics-are-put-to-the-test-at-wimbledon/ One commenter pointed out that 48 in binary is 11. More likely, those boards may be pretty old and the score is encoded in BCD, so

Re: [racket] tennis and programming, not completely off-topic

2010-06-24 Thread Raoul Duke
On Thu, Jun 24, 2010 at 11:03 AM, Matthias Felleisen wrote: A bit later the sites internet ticker also quit. Same reason. I have no clue what the number 48 does to computer scientists. I would have understood 64 perhaps, but the game went even beyond that. for that kind of fun, i love/hate readin

[racket] tennis and programming, not completely off-topic

2010-06-24 Thread Matthias Felleisen
Quote FAZ: > Vier Matchbälle hatte Isner in der Partie vergeben, einen bei 10:9, zwei bei > 33:32 und einen bei 59:58, Mahut wehrte alle ab. Bei 47:47 fiel die > elektronische Anzeigetafel aus, weil so ein Spielstand nicht vorgesehen ist, > im Internet war der Score auch nicht mehr zu

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Jon Rafkind
On 06/24/2010 04:03 AM, Insik Cho wrote: Hi buddies, I like a normal shell interactive environment. After I'm working in console 'racket,' I don't want to lose all the definitions I have made. How can I save the definitions to an external file, i.e., 'xxx.ss'? Thanks in advance. - Joe

Re: [racket] Sending s-expr to repl

2010-06-24 Thread Karl Winterling
Copy the definition, paste it into the REPL, and press return. Otherwise subx: if (bac >= 0.15) exit(-1); else { drink_beer(); hit_head_with_brick(&SELF); goto subx; } On Thu, Jun 24, 2010 at 12:34 AM, Jordan Johnson wrote: > See >  http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.

Re: [racket] View HTML source code in racket

2010-06-24 Thread Eli Barzilay
On Jun 23, Greg Hendershott wrote: > > (define (find-elements xexpr tag-name) > ;; Given an x-expression return a list of all the elements starting > with tag-name. > (if (empty? xexpr) > '() > (let ([x (first xexpr)]) > (if (and (list? x) (not (empty? x))) > (i

Re: [racket] Need a namespace

2010-06-24 Thread michael rice
That fixed it. Thanks, Michael --- On Thu, 6/24/10, Noel Welsh wrote: From: Noel Welsh Subject: Re: [racket] Need a namespace To: "michael rice" Cc: users@racket-lang.org Date: Thursday, June 24, 2010, 11:47 AM Nope, it works as documented. Trying changing the language then, from R5RS to Mo

Re: [racket] Need a namespace

2010-06-24 Thread Noel Welsh
Nope, it works as documented. Trying changing the language then, from R5RS to Module. (But I don't see how you can get that error with the given program, so I suspect something else is going on.) HTH, N. On Thu, Jun 24, 2010 at 4:44 PM, michael rice wrote: > > Are my docs incorrect or out outdat

Re: [racket] Need a namespace

2010-06-24 Thread michael rice
Are my docs incorrect or out outdated? Michael === From: file:///usr/share/plt/doc/guide/eval.html#%28tech._current._namespace%29 #lang scheme     (eval '(cons 1 2)) This fails because the initial current namespace is empty. When you run mzscheme in interactive mode (see Inte

Re: [racket] Need a namespace

2010-06-24 Thread Noel Welsh
You're using a define in a place where you aren't allowed to put a define. E.g., this will work: (define foo 1) This won't work: (define bar (define foo 1) foo) N. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/

Re: [racket] Need a namespace

2010-06-24 Thread michael rice
I'm getting this: define: not allowed in an expression context in: (define ns (make-base-namespace)) > Maybe it's my language setting, R5RS? Also, I'm using v 4.1.2 on Fedora 13. Michael --- On Thu, 6/24/10, Noel Welsh wrote: From: Noel Welsh Subject: Re: [racket] Need a namespace To: "mic

Re: [racket] DrRacket, Emacs, REPL [was: Sending s-expr to repl]

2010-06-24 Thread Matthias Felleisen
Take a look at Dracula, the ACL2 support from DrScheme. It implements exactly that behavior. (You may even wish to take a look at our How to prove curriculum addition to HtDP. We teach freshmen how to prove theorems about graphical games.) Two points about it: 1. in the presence of true ef

Re: [racket] Need a namespace

2010-06-24 Thread Noel Welsh
It works for me... N. On Thu, Jun 24, 2010 at 4:01 PM, michael rice wrote: > > How do I make an empty namespace in DrScheme? > > This doesn't seem to work: > > #lang scheme > > (define ns (make-base-namespace)) > > > Michael _ For list-related ad

[racket] Need a namespace

2010-06-24 Thread michael rice
How do I make an empty namespace in DrScheme? This doesn't seem to work: #lang scheme (define ns (make-base-namespace)) Michael _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Jose A. Ortega Ruiz
On Thu, Jun 24 2010, Sam Tobin-Hochstadt wrote: > To quote from Jose's documentation: > > "I’ve concentrated initially in supporting those Schemes with the > richest (to my knowledge) introspection capabilities, namely, Guile > and Racket." > > I assume it's running mostly elisp underneath. :) N

Re: [racket] Keyword prefix or sufix ':'

2010-06-24 Thread Noel Welsh
On Thu, Jun 24, 2010 at 1:31 PM, Valeriya Pudova wrote: > Is there any way to make symbols with the prefix ':' behave the same as the > keywords? You'd have to write your own reader. Far less work is to adapt to the current syntax. N. _ For list-

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Jose A. Ortega Ruiz
On Thu, Jun 24 2010, Shriram Krishnamurthi wrote: > Is it running Racket underneath? Yes. And, in fact, Racket is doing most of the work, not only for evaluation, but also when it comes to obtaining metadata for completions, showing arities and argument names, listing module exports, etc., etc.

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Sam Tobin-Hochstadt
To quote from Jose's documentation: "I’ve concentrated initially in supporting those Schemes with the richest (to my knowledge) introspection capabilities, namely, Guile and Racket." I assume it's running mostly elisp underneath. :) On Thu, Jun 24, 2010 at 9:28 AM, Shriram Krishnamurthi wrote

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Shriram Krishnamurthi
Is it running Racket underneath? On Thu, Jun 24, 2010 at 2:20 PM, Jose A. Ortega Ruiz wrote: > On Thu, Jun 24 2010, Insik Cho wrote: > >> I see. >> >> Do you think if emacs is a good tool for editing, saving and executing >> racket programming? >> >> I prefer command-like environment to GUI. But,

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Jose A. Ortega Ruiz
On Thu, Jun 24 2010, Insik Cho wrote: > I see. > > Do you think if emacs is a good tool for editing, saving and executing > racket programming? > > I prefer command-like environment to GUI. But, It's inconvenient to > edit a file and enter! it separately in a shell. > > What environment or editor

Re: [racket] DrRacket, Emacs, REPL [was: Sending s-expr to repl]

2010-06-24 Thread Nadeem Abdul Hamid
> See > http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html > for a detailed answer. > I see what the blog post above is saying, but (I know, "no when no if no but"), has anyone ever used editors for some of the proof assistants, like CoqIDE or ProofGeneral mode in Emacs for Coq? T

Re: [racket] Keyword prefix or sufix ':'

2010-06-24 Thread Valeriya Pudova
There is other thread about this subject http://www.mail-archive.com/plt-...@list.cs.brown.edu/msg00959.html On 24.06.2010 16:31, Valeriya Pudova wrote: Is there any way to make symbols with the prefix ':' behave the same as the keywords? _ F

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Vincent St-Amour
At Thu, 24 Jun 2010 03:03:08 -0700, Insik Cho wrote: > After I'm working in console 'racket,' I don't want to lose all the > definitions I have made. > > How can I save the definitions to an external file, i.e., 'xxx.ss'? You can try running racket with rlwrap. In addition to giving it readline s

[racket] Keyword prefix or sufix ':'

2010-06-24 Thread Valeriya Pudova
Is there any way to make symbols with the prefix ':' behave the same as the keywords? The document "Keyword and Optional Arguments in PLT Scheme" Has the next text in the chapter "7.7 Keyword Lexical Syntax" PLT Scheme uses a #: prefix. Chicken also supports a #: prefix in addition to a : suff

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Noel Welsh
I use Emacs. See http://monospaced.posterous.com/up-and-running-with-racket HTH, N. On Thu, Jun 24, 2010 at 11:33 AM, Insik Cho wrote: > I see. > Do you think if emacs is a good tool for editing, saving and executing > racket programming? > I prefer command-like environment to GUI. But, It's

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Insik Cho
I see. Do you think if emacs is a good tool for editing, saving and executing racket programming? I prefer command-like environment to GUI. But, It's inconvenient to edit a file and enter! it separately in a shell. What environment or editor are you using for racket programming? - Joe On Thu,

Re: [racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Noel Welsh
It doesn't work that way. You should first save your defns in a file (as a module) and then load that file into racket. If you're working with command line racket you might want to look at the enter! function. N. On Thu, Jun 24, 2010 at 11:03 AM, Insik Cho wrote: > Hi buddies, > I like a normal

[racket] How can I save all the definitions in racket to a file?

2010-06-24 Thread Insik Cho
Hi buddies, I like a normal shell interactive environment. After I'm working in console 'racket,' I don't want to lose all the definitions I have made. How can I save the definitions to an external file, i.e., 'xxx.ss'? Thanks in advance. - Joe _

Re: [racket] Sending s-expr to repl

2010-06-24 Thread Jordan Johnson
See http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html for a detailed answer. Best, Jordan On Jun 24, 2010, at 12:12 AM, Mark Carter wrote: Scheme newbie here. I've always had a bee in my bonnet for the Lispy languages, but had never gotten into them fully for one reason o

[racket] Sending s-expr to repl

2010-06-24 Thread Mark Carter
Scheme newbie here. I've always had a bee in my bonnet for the Lispy languages, but had never gotten into them fully for one reason or another. I've been playing with DrRacket, and have been able to plot graphs using it. Way cool! Anyway, my actual question is: using DrRacket, is there a way of