Re: [racket-users] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
On Wednesday, September 21, 2016 at 10:42:33 AM UTC+8, Robby Findler wrote:
> It is a performance issue and the default saves memory when one creates a lot 
> of little text% objects. 
> 
> 
> Maybe we should add something to the docs. Where did you look?

The overview section for editors could include a paragraph for enabling the 
"undo" functionality, this is where I went when all else failed :-)

http://docs.racket-lang.org/gui/editor-overview.html?q=text%25

When I noticed that undo was not working, I searched the text% documentation 
for the word undo, could not find any mention of enabling it. Also, what 
confused me is that the documentation for the "add-undo" method 
mentions:

The system automatically installs undo records to undo built-in editor
operations, such as inserts, deletes, and font changes. Install an 
undoer only when it is necessary to maintain state or handle operations 
that are not built-in.

I took that to mean that everything should work if I just manipulate the text
and don't add my own snips.  Perhaps this paragraph could mention that the undo
limit is 0 by default and it should be set to a non-zero value using 
`set-max-undo-history`.

Best Regards,
Alex.

-- 
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] How to add undo functionality to text% editor?

2016-09-20 Thread Robby Findler
It is a performance issue and the default saves memory when one creates a
lot of little text% objects.

Maybe we should add something to the docs. Where did you look?

Robby

On Wednesday, September 21, 2016, Alex Harsanyi 
wrote:

> Thanks for that, it worked.
>
> Is there a reason why a new text% object has undo disabled? I could not
> find any mention of it in the documentation and 'set-max-undo-history' is
> not the first place one would look :-)
>
> Thanks again,
> Alex.
>
> On Tuesday, September 20, 2016 at 10:14:03 PM UTC+8, Matthew Flatt wrote:
> > Use the `set-max-undo-history` method to enable undo history:
> >
> >  (send m-edit set-max-undo-history 1000)
> >
> >
> > At Tue, 20 Sep 2016 06:24:49 -0700 (PDT), Alex Harsanyi wrote:
> > > Consider the following example (this is pretty much the code from
> > > http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except
> I also
> > > added a text-field%):
> > >
> > > #lang racket/gui
> > > (define f (new frame% [label "Simple Edit"]
> > >   [width 200]
> > >   [height 200]))
> > > (define c (new editor-canvas% [parent f]))
> > > (define t (new text%))
> > > (send c set-editor t)
> > >
> > > (new text-field% [parent f] [label ""] [style '(multiple)])
> > >
> > > (define mb (new menu-bar% [parent f]))
> > > (define m-edit (new menu% [label "Edit"] [parent mb]))
> > > (define m-font (new menu% [label "Font"] [parent mb]))
> > > (append-editor-operation-menu-items m-edit #f)
> > > (append-editor-font-menu-items m-font)
> > >
> > > (send f show #t)
> > >
> > > In the text% editor, normal text operations (select all,
> cut/copy/paste) work
> > > fine, but undo does not, the undo menu is grayed out and Ctrl-Z does
> not
> > > work.  Undo works fine in the text-field% below.
> > >
> > > How do I add undo functionality to text%?
> > >
> > > Thanks,
> > > Alex.
> > >
> > > --
> > > 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.
>

-- 
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] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
Thanks for that, it worked.  

Is there a reason why a new text% object has undo disabled? I could not find 
any mention of it in the documentation and 'set-max-undo-history' is not the 
first place one would look :-)

Thanks again,
Alex.

On Tuesday, September 20, 2016 at 10:14:03 PM UTC+8, Matthew Flatt wrote:
> Use the `set-max-undo-history` method to enable undo history:
> 
>  (send m-edit set-max-undo-history 1000)
> 
> 
> At Tue, 20 Sep 2016 06:24:49 -0700 (PDT), Alex Harsanyi wrote:
> > Consider the following example (this is pretty much the code from 
> > http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except I 
> > also 
> > added a text-field%):
> > 
> > #lang racket/gui
> > (define f (new frame% [label "Simple Edit"]
> >   [width 200]
> >   [height 200]))
> > (define c (new editor-canvas% [parent f]))
> > (define t (new text%))
> > (send c set-editor t)
> > 
> > (new text-field% [parent f] [label ""] [style '(multiple)])
> > 
> > (define mb (new menu-bar% [parent f]))
> > (define m-edit (new menu% [label "Edit"] [parent mb]))
> > (define m-font (new menu% [label "Font"] [parent mb]))
> > (append-editor-operation-menu-items m-edit #f)
> > (append-editor-font-menu-items m-font)
> > 
> > (send f show #t)
> > 
> > In the text% editor, normal text operations (select all, cut/copy/paste) 
> > work 
> > fine, but undo does not, the undo menu is grayed out and Ctrl-Z does not 
> > work.  Undo works fine in the text-field% below.
> > 
> > How do I add undo functionality to text%?
> > 
> > Thanks,
> > Alex.
> > 
> > -- 
> > 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] Has anyone generated Open Office or Google Docs from scribble source?

2016-09-20 Thread Matt Jadud
Hi Kathi,

PrinceXML makes pretty PDFs of the output Scribble documentation.

I downloaded it, installed it, pointed it at a Scribbled page, and the PDF
was nice; links were preserved, mostly.

prince https://docs.racket-lang.org/scribble/ -o scribble.pdf
I don't know if PDFs will work for your user(s)? I know it's not what you
asked for...

Cheers,
Matt


On Tue, Sep 20, 2016 at 6:54 AM, Kathi Fisler  wrote:

> We have a bunch of exercise handouts (for Bootstrap) in scribble format,
> and users who want them as editable Google Docs (for distribution within
> their school's LMS).  Does anyone have a backend for scribble docs that
> produces a format that can upload as an editable Gdoc?  It looks like
> OpenOffice has an xml format, for example, which I suspect scribble could
> target (at least in theory).
>
> thanks,
> Kathi
>
> --
> 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] Thanks for slideshow, racket/gui, and the rest!

2016-09-20 Thread Robby Findler
I saw the talk and thought it was great!

Robby


On Tue, Sep 20, 2016 at 9:22 AM, David Christiansen
 wrote:
> Today I delivered a talk at ICFP with slides written in slideshow,
> with an embedded Idris interactive editor and REPL. The slides got
> good feedback from the audience. I used a similar setup for my PhD
> defense in January.
>
> Thanks so much to Matthew, Robby, and the rest of you for all the hard
> work on slideshow, pict, and the editor framework that allowed me to
> do this!
>
> /David
>
> --
> 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] Re: Why is 3d3 a number?

2016-09-20 Thread Robby Findler
Patches to the reader for a more sane number syntax to be used in the
teaching languages are welcome. Note that we already have some of
these in place, as 1.2 reads as a rational in the teaching languages.

Robby


On Tue, Sep 20, 2016 at 10:39 AM, Ben Greenman
 wrote:
> Whew, fantastic! Thank you.
> (Should I tell the Fundamentals I students about R6RS?)
>
>
> On Tue, Sep 20, 2016 at 11:32 AM, Asumu Takikawa 
> wrote:
>>
>> On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
>> >Oh! Just found that common lisp used these for types:
>> >- s = short
>> >- f = single
>> >- d = double
>> >- l = long
>>
>> I think it's more specifically an R6RS thing. Quoth the standard:
>>
>>   In systems with inexact number objects of varying precisions, it may be
>> useful
>>   to specify the precision of a constant. For this purpose,
>> representations of
>>   number objects may be written with an exponent marker that indicates the
>>   desired precision of the inexact representation. The letters s, f, d,
>> and l
>>   specify the use of short, single, double, and long precision,
>> respectively.
>>   (When fewer than four internal inexact representations exist, the four
>> size
>>   specifications are mapped onto those available. For example, an
>> implementation
>>   with two internal representations may map short and single together and
>> long
>>   and double together.) In addition, the exponent marker e specifies the
>> default
>>   precision for the implementation. The default precision has at least as
>> much
>>   precision as double, but implementations may wish to allow this default
>> to be
>>   set by the user.
>>
>>   http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8
>>
>> Cheers,
>> Asumu
>
>
> --
> 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] Web-server and IDN

2016-09-20 Thread Jay McCarthy
On Wed, Sep 21, 2016 at 5:39 AM, Tobias Gerdin  wrote:
> Hello,
>
> Thanks for Racket, it really is great.
>
> Is the web-server of production quality?

There are commercial sites that are built using it.

> Does it support IDN[1] hostnames?

I believe so, as it leaves hostnames uninterpreted and can deliver any
bytes you tell it to.

Jay

>
> -Tobias
>
> [1]: https://en.wikipedia.org/wiki/Internationalized_domain_name
>
> --
> 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.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

   "Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
  - D 64:33

-- 
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] Web-server and IDN

2016-09-20 Thread Tobias Gerdin
Hello,

Thanks for Racket, it really is great.

Is the web-server of production quality?
Does it support IDN[1] hostnames?

-Tobias

[1]: https://en.wikipedia.org/wiki/Internationalized_domain_name

-- 
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] Re: Why is 3d3 a number?

2016-09-20 Thread Asumu Takikawa
On 2016-09-20 11:32:35 -0400, Asumu Takikawa wrote:
>   For example, an implementation with two internal representations may map
>   short and single together and long and double together.

BTW, I think this is what Racket does. It just has single and double.

  > 283403902385293s1
  2.834039f+15
  > 283403902385293f1
  2.834039f+15
  > 283403902385293d1
  2.83403902385293e+15
  > 283403902385293l1
  2.83403902385293e+15

As noted in the Reference:

Inexact real numbers are implemented as either single- or double-precision
  IEEE floating-point numbers—the latter by default, and the former only when a
  computation starts with numerical constants specified as single-precision
  numbers.

Cheers,
Asumu

-- 
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] Re: Why is 3d3 a number?

2016-09-20 Thread Ben Greenman
Whew, fantastic! Thank you.
(Should I tell the Fundamentals I students about R6RS?)


On Tue, Sep 20, 2016 at 11:32 AM, Asumu Takikawa 
wrote:

> On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
> >Oh! Just found that common lisp used these for types:
> >- s = short
> >- f = single
> >- d = double
> >- l = long
>
> I think it's more specifically an R6RS thing. Quoth the standard:
>
>   In systems with inexact number objects of varying precisions, it may be
> useful
>   to specify the precision of a constant. For this purpose,
> representations of
>   number objects may be written with an exponent marker that indicates the
>   desired precision of the inexact representation. The letters s, f, d,
> and l
>   specify the use of short, single, double, and long precision,
> respectively.
>   (When fewer than four internal inexact representations exist, the four
> size
>   specifications are mapped onto those available. For example, an
> implementation
>   with two internal representations may map short and single together and
> long
>   and double together.) In addition, the exponent marker e specifies the
> default
>   precision for the implementation. The default precision has at least as
> much
>   precision as double, but implementations may wish to allow this default
> to be
>   set by the user.
>
>   http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8
>
> Cheers,
> Asumu
>

-- 
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] Re: Why is 3d3 a number?

2016-09-20 Thread Asumu Takikawa
On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
>Oh! Just found that common lisp used these for types:
>- s = short
>- f = single
>- d = double
>- l = long

I think it's more specifically an R6RS thing. Quoth the standard:

  In systems with inexact number objects of varying precisions, it may be useful
  to specify the precision of a constant. For this purpose, representations of
  number objects may be written with an exponent marker that indicates the
  desired precision of the inexact representation. The letters s, f, d, and l
  specify the use of short, single, double, and long precision, respectively.
  (When fewer than four internal inexact representations exist, the four size
  specifications are mapped onto those available. For example, an implementation
  with two internal representations may map short and single together and long
  and double together.) In addition, the exponent marker e specifies the default
  precision for the implementation. The default precision has at least as much
  precision as double, but implementations may wish to allow this default to be
  set by the user.

  http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8

Cheers,
Asumu

-- 
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] Re: Why is 3d3 a number?

2016-09-20 Thread Ben Greenman
Oh! Just found that common lisp used these for types:
- s = short
- f = single
- d = double
- l = long

http://www.gigamonkeys.com/book/numbers-characters-and-strings.html

Is this still true for Racket?

On Tue, Sep 20, 2016 at 11:25 AM, Ben Greenman 
wrote:

> Just confused, is there any reason that 'd' 'e' 'f' 's' 'l' are all
> accepted as exp-mark s?
> http://docs.racket-lang.org/reference/reader.html%
> 20numbers#%28part._parse-number%29
>
>
> Before I came here I asked Wolfram Alpha. It says:
> - 3d3 is probably "3 dice with 3 sides each" and prints a histogram of
> probabilities
> - 3e3 is 3000. (Phew)
> - 3f3 is probably "3 degrees farenheit, cubed". No histogram.
> - 3s3 is probably "3 seconds cubed". But it also offers to find roots for
> "y = 3f3".
> - 3l3 is "fruit fly gene".
>
>

-- 
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] Why is 3d3 a number?

2016-09-20 Thread Ben Greenman
Just confused, is there any reason that 'd' 'e' 'f' 's' 'l' are all
accepted as exp-mark s?
http://docs.racket-lang.org/reference/reader.html%20numbers#%28part._parse-number%29


Before I came here I asked Wolfram Alpha. It says:
- 3d3 is probably "3 dice with 3 sides each" and prints a histogram of
probabilities
- 3e3 is 3000. (Phew)
- 3f3 is probably "3 degrees farenheit, cubed". No histogram.
- 3s3 is probably "3 seconds cubed". But it also offers to find roots for
"y = 3f3".
- 3l3 is "fruit fly gene".

-- 
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] DrRacket 6.5 + OS X El Capitan = slow execution

2016-09-20 Thread An Onlooker
By a stopwatch.
вторник, 16 августа 2016 г., 11:16:19 UTC+3 пользователь Ivan Kuzmin написал:
> P.S. May be it is just some strange cognitive effect. Is there a way to 
> measure time from run button pressing to printing execution results precisely 
> and objectively somehow?

-- 
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] Re: DrRacket 6.5 + OS X El Capitan = slow execution

2016-09-20 Thread An Onlooker
The same issue. Evaluating

"apple"

takes 4.5 seconds, a middle-size function takes 12 seconds.

user@>pacman -Q racket
racket 6.6-1

Linux 4.6.2-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux

CPU: Athlon, 2 GHz.

-- 
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] Importing untyped class into typed racket

2016-09-20 Thread Sourav Datta
On Tuesday, September 20, 2016 at 7:41:23 PM UTC+5:30, Matthias Felleisen wrote:
> > On Sep 20, 2016, at 4:23 AM, Sourav Datta  wrote:
> > 
> > Is it possible to import an untyped class into typed Racket? I know how to 
> > require for functions or structs but there seems to be no documentation 
> > about classes. Thanks!
> 
> 
> 
> That is the break-though of Asumu’s addition. Here is a simple example, 
> because I couldn’t find one in the docs: 
> 
> #lang racket
> 
> (module server racket
>   (provide C%)
> 
>   (define C%
> (class object%
>   (init-field world)
>   (super-new)
>   (define/public (hello)
> world
> 
> (module client typed/racket
>   (require/typed (submod ".." server)
>  (C% (Class (init-field (world String)) (hello (-> String)
>   (send (new C% [world "good bye"]) hello))
> 
> (require 'client)

Awesome, thanks!

-- 
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] Thanks for slideshow, racket/gui, and the rest!

2016-09-20 Thread David Christiansen
Today I delivered a talk at ICFP with slides written in slideshow,
with an embedded Idris interactive editor and REPL. The slides got
good feedback from the audience. I used a similar setup for my PhD
defense in January.

Thanks so much to Matthew, Robby, and the rest of you for all the hard
work on slideshow, pict, and the editor framework that allowed me to
do this!

/David

-- 
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] note about info.rkt in package conflicts docs?

2016-09-20 Thread Matthew Flatt
Yes, the documentation should be revised to exclude "info.rkt" as a
source of conflicts.

At Mon, 19 Sep 2016 12:29:52 -0400, "'John Clements' via Racket Users" wrote:
> I’m separating a package into -lib and -test packages for the first time, and 
> I’m wondering about the collection-level package files. Specifically, suppose 
> that the packages foo-lib and foo-test both contribute files to the foo 
> collection. Can each package contain its own foo/info.rkt file? Based on the 
> existing htdp libraries and on my experiments, the answer is yes. If this 
> appears in the documentation, I can’t find it. Indeed, I find this text in 
> the 
> section labeled “Package Conflicts”:
> 
> For the purposes of conflicts, a module is a file that ends in ".rkt", ".ss", 
> or ".scrbl”.
> 
> Would it make sense to amend this to
> 
> For the purposes of conflicts, a module is a file that ends in ".rkt", ".ss", 
> or ".scrbl” and is not “info.rkt”.
> 
> ?
> 
> As I write this, though, I find myself wondering about info.rkt files in 
> nested directories, and info.ss files, and differently named files written in 
> the #lang info language. Am I missing some existing documentation?
> 
> John
> 
> 
> -- 
> 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.
> 
> --
> [application/pgp-signature "signature.asc"] [~/Desktop & open] [~/Temp & open]

-- 
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] How to add undo functionality to text% editor?

2016-09-20 Thread Matthew Flatt
Use the `set-max-undo-history` method to enable undo history:

 (send m-edit set-max-undo-history 1000)


At Tue, 20 Sep 2016 06:24:49 -0700 (PDT), Alex Harsanyi wrote:
> Consider the following example (this is pretty much the code from 
> http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except I also 
> added a text-field%):
> 
> #lang racket/gui
> (define f (new frame% [label "Simple Edit"]
>   [width 200]
>   [height 200]))
> (define c (new editor-canvas% [parent f]))
> (define t (new text%))
> (send c set-editor t)
> 
> (new text-field% [parent f] [label ""] [style '(multiple)])
> 
> (define mb (new menu-bar% [parent f]))
> (define m-edit (new menu% [label "Edit"] [parent mb]))
> (define m-font (new menu% [label "Font"] [parent mb]))
> (append-editor-operation-menu-items m-edit #f)
> (append-editor-font-menu-items m-font)
> 
> (send f show #t)
> 
> In the text% editor, normal text operations (select all, cut/copy/paste) work 
> fine, but undo does not, the undo menu is grayed out and Ctrl-Z does not 
> work.  Undo works fine in the text-field% below.
> 
> How do I add undo functionality to text%?
> 
> Thanks,
> Alex.
> 
> -- 
> 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] Importing untyped class into typed racket

2016-09-20 Thread Matthias Felleisen

> On Sep 20, 2016, at 4:23 AM, Sourav Datta  wrote:
> 
> Is it possible to import an untyped class into typed Racket? I know how to 
> require for functions or structs but there seems to be no documentation about 
> classes. Thanks!



That is the break-though of Asumu’s addition. Here is a simple example, because 
I couldn’t find one in the docs: 

#lang racket

(module server racket
  (provide C%)

  (define C%
(class object%
  (init-field world)
  (super-new)
  (define/public (hello)
world

(module client typed/racket
  (require/typed (submod ".." server)
 (C% (Class (init-field (world String)) (hello (-> String)
  (send (new C% [world "good bye"]) hello))

(require 'client)

-- 
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] How to add undo functionality to text% editor?

2016-09-20 Thread Alex Harsanyi
Consider the following example (this is pretty much the code from 
http://docs.racket-lang.org/gui/editor-overview.html?q=text%25 except I also 
added a text-field%):

#lang racket/gui
(define f (new frame% [label "Simple Edit"]
  [width 200]
  [height 200]))
(define c (new editor-canvas% [parent f]))
(define t (new text%))
(send c set-editor t)

(new text-field% [parent f] [label ""] [style '(multiple)])

(define mb (new menu-bar% [parent f]))
(define m-edit (new menu% [label "Edit"] [parent mb]))
(define m-font (new menu% [label "Font"] [parent mb]))
(append-editor-operation-menu-items m-edit #f)
(append-editor-font-menu-items m-font)

(send f show #t)

In the text% editor, normal text operations (select all, cut/copy/paste) work 
fine, but undo does not, the undo menu is grayed out and Ctrl-Z does not work.  
Undo works fine in the text-field% below.

How do I add undo functionality to text%?

Thanks,
Alex.

-- 
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] Is it neccessary to learn how to define new language?

2016-09-20 Thread Lin Lee
thanks for your advice .
 Recently,I want to rewrite a web application ,it's about a survey system. I 
plan to use Racket to do this.

-- 
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] Has anyone generated Open Office or Google Docs from scribble source?

2016-09-20 Thread Jens Axel Søgaard
Worth a try: Use the html-backend for Scribble and import it in Google Docs.

/Jens Axel


2016-09-20 12:54 GMT+02:00 Kathi Fisler :

> We have a bunch of exercise handouts (for Bootstrap) in scribble format,
> and users who want them as editable Google Docs (for distribution within
> their school's LMS).  Does anyone have a backend for scribble docs that
> produces a format that can upload as an editable Gdoc?  It looks like
> OpenOffice has an xml format, for example, which I suspect scribble could
> target (at least in theory).
>
> thanks,
> Kathi
>
> --
> 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.
>



-- 
-- 
Jens Axel Søgaard

-- 
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] Has anyone generated Open Office or Google Docs from scribble source?

2016-09-20 Thread Kathi Fisler
We have a bunch of exercise handouts (for Bootstrap) in scribble format, and 
users who want them as editable Google Docs (for distribution within their 
school's LMS).  Does anyone have a backend for scribble docs that produces a 
format that can upload as an editable Gdoc?  It looks like OpenOffice has an 
xml format, for example, which I suspect scribble could target (at least in 
theory).

thanks,
Kathi

-- 
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] Importing untyped class into typed racket

2016-09-20 Thread Sourav Datta
Is it possible to import an untyped class into typed Racket? I know how to 
require for functions or structs but there seems to be no documentation about 
classes. Thanks!

-- 
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.