Re: [racket-users] Can Racket implement LockedMagicDoor example of MIXEDJAVA?

2020-08-12 Thread Ryan Culpepper
On Wed, Aug 12, 2020 at 7:19 PM Siyuan Chen  wrote:

> Dear Ryan,
>
> Thanks for your solution, it works nicely!
>
> But I still have some questions:
>
> For this particular problem of LockedMagicDoor, we can use `trait` to
> solve the `mixin` problem, but can we use the same method for more general
> problems?
>
> Since traits and mixins are essentially different, they may not mimic each
> other...
>
> IMO, they are at least 2 differences:
>
> 1. Traits can not have states, but mixin can.
>
>For example, if the `secure-trait`,  `locked-needed-trait`, and
> `magic-needed-trait` have mutable states, then you can not use `trait`.  (A
> workaround may be to convert `trait` to `mixin` first and then compose a
> "state" mixin. But this will cause the same problem of name colliding,
> because `mixin` does not support renaming)
>

No, traits can contain fields, which are mutable, so a trait can manage
state.

2. `trait-sum` is symmetric, it does not support overriding.
>
>For example, in your solution:
>
>```
>(define locked-mixin
>  (trait->mixin
>   (trait-rename (trait-sum secure-trait locked-needed-trait)
> needed-item needed-item/locked)))
>```
>
>To construct `locked-mixin`, you `trait-sum` the  `secure-trait` and
>  `locked-needed-trait`, but what if there is a default implementation of
> `needed-item` in the `secure-trait`? We even hope the `locked-needed-trait`
> can delegate to `super`, something like:
>
>```
>(define locked-needed-trait
>  (trait
>   (define/override (needed-item)
> (println "locked-needed-mixin neededItem")
> (super needed-item  ;; We want to call super.
>```
>

Right, one trait cannot override another's definitions. One thing you could
do instead is use `trait-exclude` to remove the definition of `needed-item`
from `secure-trait` before linking a trait (like `locked-needed-trait`, but
using `define/public` instead of `define/override`) that defines the
`needed-item` method. But if you do that, I think there's no way to chain
to the original definition. (I haven't tried any of this, but that's what I
get from the docs.)

The key question is:
>
> Does the current racket class system have the equivalent capabilities of
> MIXEDJAVA?
>
> More concretely, we know that Racket supports mixin, but Racket's `mixin`
> is slightly different from MIXEDJAVA. This is because we seemingly can not
> implement LockMagicDoor by using only `mixin-form` (Is this by design? I
> heard that there are some historical origins of MIXEDJAVA and MzScheme).
>
> But Racket supports two additional features, i.e.  `inner` and `trait`,
>  which are not in MIXEDJAVA.
>
> Consequently,  I'm curious about whether there is any design pattern in
> Racket that can simulate the semantics of MIXEDJAVA ?
>

I'm not sure, but I think the answer is no. If we distinguish "method
names" from "method slots" (or "vtable slots", to put it in terms of one
implementation strategy), then I think this example requires the ability to
change a method name to refer to a new method slot (but only for
subclasses; existing references point to the original slot), and I don't
think Racket's class system offers that ability. In particular, I think
that feature is not expressible using `inner`, although `inner` does
require a more complicated notation of "method slot" than a Java-style
class system. Anyway, that feature sounds maybe more dangerous than
worthwhile.

But if you know that you might want to apply the secure mixin multiple
times with different needed items, then there are other ways to write that
code. One is to parameterize the mixin by the needed item directly:

  ;; make-secure-mixin : Item -> (impl/c door<%>) -> (impl/c door<%>)
  (define (make-secure-mixin the-needed-item)
(mixin (door<%>) (door<%>)
  (super-new)
  (define/override (can-open p)
(println "secure-mixin can-open")
(cond [(send p has-item the-needed-item) ]
  [else ]

  (define locked-needed-mixin (make-secure-mixin the-key))
  (define magic-needed-mixin (make-secure-mixin the-spell-book))

Another is to parameterize `secure-mixin` over the *name* of the auxiliary
hook method, using `define-member-name` etc. That avoids the problem of
needing the same *name* to refer to different "slots" at different points
in time; instead, just use two different names. But IIRC, if you read the
APLAS paper on traits in Racket (Flatt et al), you discover that `trait` is
just syntactic sugar for this kind of member-name manipulation. So traits
are this design pattern turned into a linguistic construct.

Ryan

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CANy33q%3DWc594hxD3Y6j

Re: [racket-users] Can Racket implement LockedMagicDoor example of MIXEDJAVA?

2020-08-12 Thread Siyuan Chen
Dear Ryan,

Thanks for your solution, it works nicely!

But I still have some questions:

For this particular problem of LockedMagicDoor, we can use `trait` to solve
the `mixin` problem, but can we use the same method for more general
problems?

Since traits and mixins are essentially different, they may not mimic each
other...

IMO, they are at least 2 differences:

1. Traits can not have states, but mixin can.

   For example, if the `secure-trait`,  `locked-needed-trait`, and
`magic-needed-trait` have mutable states, then you can not use `trait`.  (A
workaround may be to convert `trait` to `mixin` first and then compose a
"state" mixin. But this will cause the same problem of name colliding,
because `mixin` does not support renaming)

2. `trait-sum` is symmetric, it does not support overriding.

   For example, in your solution:

   ```
   (define locked-mixin
 (trait->mixin
  (trait-rename (trait-sum secure-trait locked-needed-trait)
needed-item needed-item/locked)))
   ```

   To construct `locked-mixin`, you `trait-sum` the  `secure-trait` and
 `locked-needed-trait`, but what if there is a default implementation of
`needed-item` in the `secure-trait`? We even hope the `locked-needed-trait`
can delegate to `super`, something like:

   ```
   (define locked-needed-trait
 (trait
  (define/override (needed-item)
(println "locked-needed-mixin neededItem")
(super needed-item  ;; We want to call super.
   ```

The key question is:

Does the current racket class system have the equivalent capabilities of
MIXEDJAVA?

More concretely, we know that Racket supports mixin, but Racket's `mixin`
is slightly different from MIXEDJAVA. This is because we seemingly can not
implement LockMagicDoor by using only `mixin-form` (Is this by design? I
heard that there are some historical origins of MIXEDJAVA and MzScheme).

But Racket supports two additional features, i.e.  `inner` and `trait`,
 which are not in MIXEDJAVA.

Consequently,  I'm curious about whether there is any design pattern in
Racket that can simulate the semantics of MIXEDJAVA ?

Thanks.

Best regards,
Siyuan Chen


On Tue, Aug 11, 2020 at 10:09 PM Ryan Culpepper 
wrote:

> I don't know of a way to solve that problem using the Racket class system
> alone, but here is a solution that uses traits instead, which allow you to
> rename the hook methods after the fact so they don't collide.
>
>   ;; 
>   (require racket/trait)
>
>   (define secure-trait
> (trait
>  (inherit needed-item)
>  (define/override (can-open p)
>(println "secure-mixin can-open")
>(define item (needed-item))
>(cond
>  ((not (send p has-item item)) (printf "You don't have the Key
> ~v\n" item)
>   #f)
>  (else (printf "Using Key... ~v\n" item)
>(super can-open p))
>
>   (define locked-needed-trait
> (trait
>  (define/public (needed-item)
>(println "locked-needed-mixin neededItem")
>the-key)))
>
>   (define magic-needed-trait
> (trait
>  (define/public (needed-item)
>(println "magic-needed-mixin neededItem")
>the-spell-book)))
>
>   (define locked-mixin
> (trait->mixin
>  (trait-rename (trait-sum secure-trait locked-needed-trait)
>needed-item needed-item/locked)))
>
>   (define magic-mixin
> (trait->mixin
>  (trait-rename (trait-sum secure-trait magic-needed-trait)
>needed-item needed-item/magic)))
>   ;; 
>
> Ryan
>
>
> On Sun, Aug 9, 2020 at 11:12 PM Siyuan Chen  wrote:
>
>> Hi all,
>>
>> Recently I read the paper "Classes and Mixins" by Matthew Flatt, Shriram
>> Krishnamurthi and Matthias Felleisen.
>>
>> In this paper, the authors presented MIXEDJAVA.
>>
>> In MIXEDJAVA,
>>
>>> A programmer implements mixins in exactly the same
>>> way as a derived class, except that the programmer cannot
>>> rely on the implementation of the mixin's superclass, only
>>> on its interface. We consider this an advantage of mixins
>>> because it enforces the maxim "program to an interface, not
>>> an implementation".
>>>
>> It is very close to the mixin form in Racket, because we can specific
>> interface in the mixin form:
>>
>> ```
>> (mixin (interface-expr ...) (interface-expr ...)
>>   class-clause ...)
>> ```
>>
>> In Chapter 3, they also introduced an example (a maze adventure game, I
>> called it LockedMagicDoor) which uses the system.
>>
>> My question is:
>>
>> Is it possible to implement LockedMagicDoor in Racket?
>>
>>
>> I did some experiments but failed.
>>
>> See following code (or
>> https://gist.github.com/chansey97/aecffabb2885c83fa040ba677bde5de4):
>>
>> ```
>> #lang racket
>>
>> (define the-key 'the-key)
>> (define the-spell-book 'the-spell-book)
>>
>> (define person%
>>   (class object%
>> (init-field items h)
>> (super-new)
>>
>> (define/public (has-item item)
>>   (member item items))
>>
>> (define/public (height)
>>  

Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Solved some of which was offline.

First was my misunderstanding about having to document implied procedures
when using a struct. Second was that I missed a parameter
print-as-expression which should be parameterized as #f for the evaluator.

Thanks everyone!
Deren

On Wed, Aug 12, 2020, 7:08 AM Deren Dohoda  wrote:

> Hi racketeers,
>
> I have two questions. The first is: is there a way to have scribble /
> sandbox use the gen:custom-write property of a structure? When I use
> @examples the output is just the bare structure output, not using the
> gen:custom-write procedure.
>
> Second, I am working on a very simple polynomial library using 7.7 and
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure
> polynomial?.
>
> This would lead me to believe I have somehow required or defined things
> multiple times. However my "main.rkt" is just a one file require and an
> all-from-out. The underlying library does not use (provide (struct-out
> ...)), I only (provide polynomial?).
>
> Do structs somehow mess with scribble here? A small search reveals only a
> single posting from the developers library with the comment "fix your
> library." Love to, but what's the problem?
>
> Thanks for any thoughts,
> Deren
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/oKtKqyQZDg4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpnj5U8AG3yRYir5oMvHbHq9s0SfN9x-UYL29v4Rp-Fi-A%40mail.gmail.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Christopher Lemmer Webber
That's a very interesting idea... I might give that a try!

Simon Schlee writes:

> Another approach might be to use multiple editor-snip% 
> https://docs.racket-lang.org/gui/editor-snip_.html
> within a pasteboard% https://docs.racket-lang.org/gui/pasteboard_.html
>
> Or possibly together with other snip instances, I currently don't have the 
> time to experiment with it
> and no experience with pasteboards, so I am not sure whether that would 
> work well and I am just dropping the idea ;)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87pn7wat7d.fsf%40dustycloud.org.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi Matthew,

> A `@defstruct*[polynomial .]` form does document `polynomial?`.
> Although the word `polynomial?` doesn't appear on the page, it's
> implied by the `struct` form on the page.

Thank you, I understand.

Deren

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpm4SRSpBWNDfv1rCKJgc7bzpkFithao%2BB7U1R6200UEkQ%40mail.gmail.com.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Matthew Flatt
At Wed, 12 Aug 2020 08:32:25 -0400, Deren Dohoda wrote:
> If I remove the @defproc of polynomial? then I do not get the error, though
> then of course that definition never appears in the document. However, if I
> instead remove the @defstruct* then the error also disappears. But
> @defstruct* does not document the automatically generated procedure so it
> seems that it shouldn't introduce it as far as scribble is concerned. Is
> this a bug?

A `@defstruct*[polynomial .]` form does document `polynomial?`.
Although the word `polynomial?` doesn't appear on the page, it's
implied by the `struct` form on the page.

As another example, if you search the docs for `exn?`, you'll arrive at
a `struct` declaration for `exn`, and not a separate `exn?` entry.


Matthew

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200812065032.249%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi Matthew,

Structs should not cause any particular problem for Scribble. I'm
> puzzled by the problem with `gen:custom-write`, because that should
> certainly work with sandboxes and `@examples`.

I will try to look at some included documents with the main distribution to
see if I can figure out what I'm doing wrong then.

The "collected information multiple times" error would be caused by
> multiple declarations of `polynominal?` in the docs, as opposed to
> multiple definitions in the code. Depending on when the error happens,
> though, it could be due to multiple instances of a whole document, as
> Laurent suggests.
>
If I remove the @defproc of polynomial? then I do not get the error, though
then of course that definition never appears in the document. However, if I
instead remove the @defstruct* then the error also disappears. But
@defstruct* does not document the automatically generated procedure so it
seems that it shouldn't introduce it as far as scribble is concerned. Is
this a bug?

Deren

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpn9E_Qz78vi8FCbKkKKfugk-eWEgjo%2ByHn-raGO5Hu7rg%40mail.gmail.com.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Matthew Flatt
At Wed, 12 Aug 2020 04:07:58 -0700 (PDT), Deren Dohoda wrote:
> I have two questions. The first is: is there a way to have scribble / 
> sandbox use the gen:custom-write property of a structure? When I use 
> @examples the output is just the bare structure output, not using the 
> gen:custom-write procedure.
> 
> Second, I am working on a very simple polynomial library using 7.7 and 
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib 
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure 
> polynomial?.
> 
> This would lead me to believe I have somehow required or defined things 
> multiple times. However my "main.rkt" is just a one file require and an 
> all-from-out. The underlying library does not use (provide (struct-out 
> ...)), I only (provide polynomial?). 
> 
> Do structs somehow mess with scribble here?

Structs should not cause any particular problem for Scribble. I'm
puzzled by the problem with `gen:custom-write`, because that should
certainly work with sandboxes and `@examples`.

The "collected information multiple times" error would be caused by
multiple declarations of `polynominal?` in the docs, as opposed to
multiple definitions in the code. Depending on when the error happens,
though, it could be due to multiple instances of a whole document, as
Laurent suggests.


Matthew

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200812061131.3d1%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Utah snapshots will switch to CS by default

2020-08-12 Thread Matthew Flatt
CS will be built on Precise, so the "current" alias with "precise" will
continue to work, and BC will continue to be built on Precise.

But CS will also be built on Xenial --- mostly because that build is
set up, but maybe it's a step toward migrating the build.

At Wed, 12 Aug 2020 10:17:15 +0300, Bogdan Popa wrote:
> Thanks for the heads-up!  Will CS continue to be built on Xenial and BC
> on Precise?
> 
> Matthew Flatt writes:
> 
> > As you may know, the Racket Git repo recently switched to Racket CS as
> > the default build. That is, if you check out the repo and `make`, then
> > you get an in-place Racket CS build instead of Racket BC.
> >
> > The next step in moving toward Racket CS is to try switching the
> > snapshot builds. Out current plan is to switch the Utah build on August
> > 13. The Northwestern snapshot build will be unchanged, for now. This
> > change will have no effect on the regular, release downloads.
> >
> > The layout of the page at
> >
> >  https://www.cs.utah.edu/plt/snapshots/
> >
> > will change so that CS and BC builds are grouped together, more like
> > the Northwestern snapshot layout, but an installer that doesn't have
> > "BC" in its link will download a Racket CS installer.
> >
> > If you have an automated process that pulls from the snapshot site,
> > then it probably downloads something like
> >
> > 
> https://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-
> linux-precise.sh
> >
> > As of August 13, that will download a Racket CS installer instead of a
> > BC installer, because there's no "-bc" suffix in the name.
> >
> > Racket BC builds will still be available; you'll just have to
> > specifically select a download option with "BC" in the link name or
> > "-bc" in the URL. For example,
> >
> > 
> https://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-
> linux-precise-bc.sh
> >
> > will download a Racket BC installer. For now, 32-bit Windows and Mac OS
> > installers will be available only for BC, because we view those as
> > legacy platforms.
> >
> > For consistently, you'll be able to access the CS installers using a
> > "-cs" suffix. The installer name without a "-cs" or "-bc" suffix is an
> > aliases for one with "-cs". Of course, the "current" names are all
> > aliases for installers that have a specific version number.
> >
> > While we're adjusting installer names, the canonical name for Minimal
> > Racket installers will change to "racket-minimal-..." instead of
> > "min-racket-...". The new name matches the names used for releases. For
> > the foreseeable future, "min-racket-..." aliases will still work, but
> > you should migrate to "racket-minimal-..." if you have an automated
> > process that uses "min-racket-...".
> >
> >
> > Matthew
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/m2wo242v0k.fsf%40192.168.0.142.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200812055324.95%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Laurent
I have no idea about custom-write, but for the duplicate keys, maybe you
installed the collection multiple times? Take a look at the output of `raco
pkg show` maybe.

On Wed, Aug 12, 2020 at 12:08 PM Deren Dohoda 
wrote:

> Hi racketeers,
>
> I have two questions. The first is: is there a way to have scribble /
> sandbox use the gen:custom-write property of a structure? When I use
> @examples the output is just the bare structure output, not using the
> gen:custom-write procedure.
>
> Second, I am working on a very simple polynomial library using 7.7 and
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure
> polynomial?.
>
> This would lead me to believe I have somehow required or defined things
> multiple times. However my "main.rkt" is just a one file require and an
> all-from-out. The underlying library does not use (provide (struct-out
> ...)), I only (provide polynomial?).
>
> Do structs somehow mess with scribble here? A small search reveals only a
> single posting from the developers library with the comment "fix your
> library." Love to, but what's the problem?
>
> Thanks for any thoughts,
> Deren
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaFi8JZaMUkGOXXorTGN0Cj0yW8LZJ5Ukh0sy%3D9RiOR6_A%40mail.gmail.com.


[racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi racketeers,

I have two questions. The first is: is there a way to have scribble / 
sandbox use the gen:custom-write property of a structure? When I use 
@examples the output is just the bare structure output, not using the 
gen:custom-write procedure.

Second, I am working on a very simple polynomial library using 7.7 and 
during the creation of the docs I receive this warning:
"WARNING: collected information for key multiple times: '(dep ((lib 
"simple-polynomial/main.rkt") polynomial?)); values: #t #t"
among other similar warnings all seeming to point to the procedure 
polynomial?.

This would lead me to believe I have somehow required or defined things 
multiple times. However my "main.rkt" is just a one file require and an 
all-from-out. The underlying library does not use (provide (struct-out 
...)), I only (provide polynomial?). 

Do structs somehow mess with scribble here? A small search reveals only a 
single posting from the developers library with the comment "fix your 
library." Love to, but what's the problem? 

Thanks for any thoughts,
Deren

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Laurent
You can also cheat by writing the name with the same color as the
background on the next lines (kind of like \vphantom in LaTeX). This has
the advantage of aligning based on the length of each name instead of
pushing everything to the right of the longest name, while working for any
font.

A better approach to achieve the same result is to do a real \vphantom by
writing the text in a separate box, obtaining the width and then inserting
a blank snip of the same width.

But if you use a fixed-width font, you can of course replace the names with
spaces on the next lines.

On Mon, Aug 10, 2020 at 8:32 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Hello,
>
> I'm building a little chat application with Racket.  Overall Racket's
> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
> stuff to build the chat.  But a fairly standard thing to do with chat
> applications is to have text like:
>
> (Beware, fixed width ascii art ahead)
>
>  ..
>  | FooChat Deluxe  [X]|
>  ||
>  | File  Blah |
>  ||
>  |  | It's snowing outside!! | alice   |
>  || In August  | bob |
>  |  | Nevermind, the snow is a representation of | carol   |
>  | | collective anxiety about the world | |
>  || Oh okay it is snowing then | |
>  ||
>  | [Better go get some snow shoes then___] [Send] |
>  ''
>
> The core idea there being that usernames left-align to the text.
>
> I'm not sure what's the nicest way to do this, though I've taken a guess
> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
> I'd be happy to look at that but I can't really find it in the drracket
> repository and am not sure where it would be?
>
> (I guess one other complication is that if you copy-pasta text it would
> be great to still be able to copy paste the names too, but I can think
> of some kludgery that might make that possible.)
>
>  - Chris
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaEaoT0GKBBjXuHGvxkwk_ygex6EXtr7_tQajw7chaVzZA%40mail.gmail.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Simon Schlee
Another approach might be to use multiple editor-snip% 
https://docs.racket-lang.org/gui/editor-snip_.html
within a pasteboard% https://docs.racket-lang.org/gui/pasteboard_.html

Or possibly together with other snip instances, I currently don't have the 
time to experiment with it
and no experience with pasteboards, so I am not sure whether that would 
work well and I am just dropping the idea ;)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6facbadb-2125-4077-b3f9-e4665bd25265o%40googlegroups.com.


Re: [racket-users] Utah snapshots will switch to CS by default

2020-08-12 Thread Bogdan Popa
Thanks for the heads-up!  Will CS continue to be built on Xenial and BC
on Precise?

Matthew Flatt writes:

> As you may know, the Racket Git repo recently switched to Racket CS as
> the default build. That is, if you check out the repo and `make`, then
> you get an in-place Racket CS build instead of Racket BC.
>
> The next step in moving toward Racket CS is to try switching the
> snapshot builds. Out current plan is to switch the Utah build on August
> 13. The Northwestern snapshot build will be unchanged, for now. This
> change will have no effect on the regular, release downloads.
>
> The layout of the page at
>
>  https://www.cs.utah.edu/plt/snapshots/
>
> will change so that CS and BC builds are grouped together, more like
> the Northwestern snapshot layout, but an installer that doesn't have
> "BC" in its link will download a Racket CS installer.
>
> If you have an automated process that pulls from the snapshot site,
> then it probably downloads something like
>
> https://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-linux-precise.sh
>
> As of August 13, that will download a Racket CS installer instead of a
> BC installer, because there's no "-bc" suffix in the name.
>
> Racket BC builds will still be available; you'll just have to
> specifically select a download option with "BC" in the link name or
> "-bc" in the URL. For example,
>
> https://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-x86_64-linux-precise-bc.sh
>
> will download a Racket BC installer. For now, 32-bit Windows and Mac OS
> installers will be available only for BC, because we view those as
> legacy platforms.
>
> For consistently, you'll be able to access the CS installers using a
> "-cs" suffix. The installer name without a "-cs" or "-bc" suffix is an
> aliases for one with "-cs". Of course, the "current" names are all
> aliases for installers that have a specific version number.
>
> While we're adjusting installer names, the canonical name for Minimal
> Racket installers will change to "racket-minimal-..." instead of
> "min-racket-...". The new name matches the names used for releases. For
> the foreseeable future, "min-racket-..." aliases will still work, but
> you should migrate to "racket-minimal-..." if you have an automated
> process that uses "min-racket-...".
>
>
> Matthew

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/m2wo242v0k.fsf%40192.168.0.142.