Re: [racket-users] visit a sequence of files

2020-04-21 Thread Robby Findler
A (Racket) script that calls "open" (on a mac) and uses some state to keep
track of what "next" means seems straightforward. Probably this can also be
integrated via quickscript so It becomes a key binding. And maybe you want
some small number of key bindings that assign grades and then move on to
the next one?

(Not having tried it :)

Robby

On Tue, Apr 21, 2020 at 4:05 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:

> I would love that, but they’re not all in one directory. Maybe the easiest
> solution would be to write a script to temporarily move them all into one
> directory. In fact, as I think about this harder, I realize that the
> biggest problem may be that Apple’s file dialog doesn’t facilitate moving
> along a nested structure in the ways that I want, so temporarily moving
> them into a single directory is almost certainly what I want to do.
>
> Thanks for the ideas!
>
> Related note: it turns out that emacs has “find-dired”, which more or less
> does the same thing, by allowing you to specify a virtual “directory” as a
> set of arguments to ‘find’.
>
> Thanks again,
>
> John
>
> > On Apr 21, 2020, at 1:43 PM, David Storrs 
> wrote:
> >
> > Ah, got it.  Well, as to opening all the files, you can select them all
> in Finder and Cmd+O.  (Presumably the equivalent works on Windows.) Can't
> help you with the aesthetics, sorry.
> >
> > On Tue, Apr 21, 2020 at 4:38 PM John Clements 
> wrote:
> > Well, sure… once you open all the files. Opening all the files is the
> painful part. Also, the display of tabs is not totally great when you have
> sixty or seventy of them open. Sorry, it might not have been clear that I
> want a list of sixty or seventy files.
> >
> > John
> >
> > > On Apr 21, 2020, at 1:34 PM, David Storrs 
> wrote:
> > >
> > > I don't use DrRacket much, but would the normal 'previous / next
> window' commands work for you?  On Mac it's:
> > > previous window:  Shft + Cmd + ~
> > > next window: Cmd + ~
> > >
> > > or
> > >
> > > previous window: Cmd + 
> > > next window: Cmd + 
> > >
> > > On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users <
> racket-users@googlegroups.com> wrote:
> > > Here’s a question I have about both DrRacket and Emacs. It often
> happens in my workflow (grading files, for instance) that I want to set up
> a list of files, and then have an easy way to move forward or back in that
> list (“next file”, “previous file”). I see that emacs has a function called
> “next-file” which can move forward and back in a list of files apparently
> specified by a tags-table file; is that the easiest way to do something
> like this in emacs, or am I missing something obvious? In DrRacket, I’m
> guessing that there’s no existing functionality that would allow me to
> specify a list of files and move back and forth between them. I’m guessing
> I could implement something like this pretty easily … would this be a good
> job for Laurent Orseau’s Quickscript?
> > >
> > > I would absolutely love to hear that I’ve missed something obvious!
> > >
> > > Many thanks!
> > >
> > > 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.
> > > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net
> .
> >
> >
> >
>
>
>
> --
> 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/ba809078-79dc-4773-99c6-00152dcd368f%40mtasv.net
> .
>

-- 
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/CAL3TdOM8HR7qpei-fgnP1FtU9T4k1daFGyxGBtPqaRvX5j1Q4g%40mail.gmail.com.


[racket-users] Re: New week, new Racket! What are you folks up to?

2020-04-21 Thread Ryan Kramer
I'm finally finishing up a major overhaul of Plisqin, my alternative to 
SQL. I don't think I will consider it "stable" just yet, but it is getting 
much closer. The biggest new feature is a type system that prevents the 
three-valued logic mistakes that are too easy to make in SQL. I also hope 
to write better documentation this time around thanks to a better example 
database. (I've ported the AdventureWorks schema and some of the data to 
SQLite.)

I also think I can add basic Typed Racket support pretty easily. If I know 
the names and types of each column that a query will produce, I can expose 
this to Typed Racket as, for example:

(: get-users (-> DbConnection
 (Sequenceof (Object (field [first-name String]
[last-name String]
[age Number])

Will this actually be useful? I'm not sure, but at this point it doesn't 
seem like much more work than the untyped version. I'd welcome advice here. 
Is "fields vs methods" worth thinking about? Or maybe Object isn't the best 
type to use. But Object seems like the best way to get structural-ish 
typing, which is probably better than (Sequenceof get-users-result) or 
something like that.


On Sunday, April 19, 2020 at 12:04:18 PM UTC-5, Stephen De Gabrielle wrote:
>
> New week, new Racket! What are you folks up to? 
>
> Answer here or on 
> - https://racket.slack.com/ (Sign up at 
> https://racket-slack.herokuapp.com/ ) 
> - `#racket` IRC on freenode.net https://botbot.me/freenode/racket/ 
> - Tweet @racketlang on Twitter 
> - Racket discord https://discord.gg/6Zq8sH5 
> - [r/racket](https://www.reddit.com/r/Racket) 
>
> Don’t forget to sign up for, and contribute to Racket News at 
> https://racket-news.com/ AND submit your links to Racket Stories 
> https://racket-stories.com/
>
> Kind regards, 
>
> Stephen
>
>
>
>

-- 
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/c6888141-abfd-4073-ac3c-24f20a7dcacd%40googlegroups.com.


Re: [racket-users] Typed version of sxml?

2020-04-21 Thread Hendrik Boom
On Tue, Apr 21, 2020 at 05:30:40PM -0400, John Clements wrote:
> Are you asking because you’d like your own code using SXML to be typed, or 
> because you’d like the sxml implementation to be typed? I think another way 
> of asking this is: are you worried about bugs in your code, or about bugs in 
> Oleg’s code?

About bugs in my code.

> I think that rewriting the sxml library into TR would be a lot 
> of work, but developing a TR representation for sxml terms seems quite 
> reasonable;

> of course, you’d pay the price of checking the type every time 
> you crossed the boundary into sxml library code, I suppose.

That's the price I'd prefer not to pay.  I trust Oleg's code.  I don't trust 
mine without the most exhaustive testing program, which normally includes 
static type checking.

-- hendrik

> 
> John
> 
> > On Apr 21, 2020, at 2:18 PM, Hendrik Boom  wrote:
> > 
> > Is there a typed version of sxml?
> > Its data representation would seem to be fairly easy to specify by a few 
> > corecursice define-type's.
> > 
> > I's like to get the result of
> >   (ssax:xml->sxml in '())
> > as a typed value without having to waste time doing an exhaustive  
> > run-time type-check on its output.  Because it *will* be OK.
> > The xml file I'm dealing with is 2564178 bytes.
> > 
> > (I'm glad I have RAM nowadays.  The first Lisp I ever used ran on a 
> > machine with 20.000 digits of memory (approx 10K in today's units).
> > 
> > Failing anything else I suppose I could define
> >  (define-type Xml Any)
> > but that seems kind of feeble.
> > 
> > -- hendrik
> > 
> > -- 
> > 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/20200421211829.uo3ikwfwotr6zcf5%40topoi.pooq.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/20200421215657.ix2kwts77p7eqlxu%40topoi.pooq.com.


Re: [racket-users] Typed version of sxml?

2020-04-21 Thread 'John Clements' via Racket Users
Are you asking because you’d like your own code using SXML to be typed, or 
because you’d like the sxml implementation to be typed? I think another way of 
asking this is: are you worried about bugs in your code, or about bugs in 
Oleg’s code? I think that rewriting the sxml library into TR would be a lot of 
work, but developing a TR representation for sxml terms seems quite reasonable; 
of course, you’d pay the price of checking the type every time you crossed the 
boundary into sxml library code, I suppose.

John

> On Apr 21, 2020, at 2:18 PM, Hendrik Boom  wrote:
> 
> Is there a typed version of sxml?
> Its data representation would seem to be fairly easy to specify by a few 
> corecursice define-type's.
> 
> I's like to get the result of
>   (ssax:xml->sxml in '())
> as a typed value without having to waste time doing an exhaustive  
> run-time type-check on its output.  Because it *will* be OK.
> The xml file I'm dealing with is 2564178 bytes.
> 
> (I'm glad I have RAM nowadays.  The first Lisp I ever used ran on a 
> machine with 20.000 digits of memory (approx 10K in today's units).
> 
> Failing anything else I suppose I could define
>  (define-type Xml Any)
> but that seems kind of feeble.
> 
> -- hendrik
> 
> -- 
> 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/20200421211829.uo3ikwfwotr6zcf5%40topoi.pooq.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/b14c3ce3-c8c5-400b-83e8-1d4de2cad2da%40mtasv.net.


[racket-users] Typed version of sxml?

2020-04-21 Thread Hendrik Boom
Is there a typed version of sxml?
Its data representation would seem to be fairly easy to specify by a few 
corecursice define-type's.

I's like to get the result of
   (ssax:xml->sxml in '())
as a typed value without having to waste time doing an exhaustive  
run-time type-check on its output.  Because it *will* be OK.
The xml file I'm dealing with is 2564178 bytes.

(I'm glad I have RAM nowadays.  The first Lisp I ever used ran on a 
machine with 20.000 digits of memory (approx 10K in today's units).

Failing anything else I suppose I could define
  (define-type Xml Any)
but that seems kind of feeble.

-- hendrik

-- 
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/20200421211829.uo3ikwfwotr6zcf5%40topoi.pooq.com.


Re: [racket-users] visit a sequence of files

2020-04-21 Thread 'John Clements' via Racket Users
I would love that, but they’re not all in one directory. Maybe the easiest 
solution would be to write a script to temporarily move them all into one 
directory. In fact, as I think about this harder, I realize that the biggest 
problem may be that Apple’s file dialog doesn’t facilitate moving along a 
nested structure in the ways that I want, so temporarily moving them into a 
single directory is almost certainly what I want to do.

Thanks for the ideas!

Related note: it turns out that emacs has “find-dired”, which more or less does 
the same thing, by allowing you to specify a virtual “directory” as a set of 
arguments to ‘find’.

Thanks again,

John

> On Apr 21, 2020, at 1:43 PM, David Storrs  wrote:
> 
> Ah, got it.  Well, as to opening all the files, you can select them all in 
> Finder and Cmd+O.  (Presumably the equivalent works on Windows.) Can't help 
> you with the aesthetics, sorry.
> 
> On Tue, Apr 21, 2020 at 4:38 PM John Clements  
> wrote:
> Well, sure… once you open all the files. Opening all the files is the painful 
> part. Also, the display of tabs is not totally great when you have sixty or 
> seventy of them open. Sorry, it might not have been clear that I want a list 
> of sixty or seventy files.
> 
> John
> 
> > On Apr 21, 2020, at 1:34 PM, David Storrs  wrote:
> > 
> > I don't use DrRacket much, but would the normal 'previous / next window' 
> > commands work for you?  On Mac it's:
> > previous window:  Shft + Cmd + ~
> > next window: Cmd + ~ 
> > 
> > or 
> > 
> > previous window: Cmd + 
> > next window: Cmd + 
> > 
> > On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users 
> >  wrote:
> > Here’s a question I have about both DrRacket and Emacs. It often happens in 
> > my workflow (grading files, for instance) that I want to set up a list of 
> > files, and then have an easy way to move forward or back in that list 
> > (“next file”, “previous file”). I see that emacs has a function called 
> > “next-file” which can move forward and back in a list of files apparently 
> > specified by a tags-table file; is that the easiest way to do something 
> > like this in emacs, or am I missing something obvious? In DrRacket, I’m 
> > guessing that there’s no existing functionality that would allow me to 
> > specify a list of files and move back and forth between them. I’m guessing 
> > I could implement something like this pretty easily … would this be a good 
> > job for Laurent Orseau’s Quickscript?
> > 
> > I would absolutely love to hear that I’ve missed something obvious!
> > 
> > Many thanks!
> > 
> > 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.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net.
> 
> 
> 



-- 
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/ba809078-79dc-4773-99c6-00152dcd368f%40mtasv.net.


Re: [racket-users] visit a sequence of files

2020-04-21 Thread David Storrs
Ah, got it.  Well, as to opening all the files, you can select them all in
Finder and Cmd+O.  (Presumably the equivalent works on Windows.) Can't help
you with the aesthetics, sorry.

On Tue, Apr 21, 2020 at 4:38 PM John Clements 
wrote:

> Well, sure… once you open all the files. Opening all the files is the
> painful part. Also, the display of tabs is not totally great when you have
> sixty or seventy of them open. Sorry, it might not have been clear that I
> want a list of sixty or seventy files.
>
> John
>
> > On Apr 21, 2020, at 1:34 PM, David Storrs 
> wrote:
> >
> > I don't use DrRacket much, but would the normal 'previous / next window'
> commands work for you?  On Mac it's:
> > previous window:  Shft + Cmd + ~
> > next window: Cmd + ~
> >
> > or
> >
> > previous window: Cmd + 
> > next window: Cmd + 
> >
> > On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users <
> racket-users@googlegroups.com> wrote:
> > Here’s a question I have about both DrRacket and Emacs. It often happens
> in my workflow (grading files, for instance) that I want to set up a list
> of files, and then have an easy way to move forward or back in that list
> (“next file”, “previous file”). I see that emacs has a function called
> “next-file” which can move forward and back in a list of files apparently
> specified by a tags-table file; is that the easiest way to do something
> like this in emacs, or am I missing something obvious? In DrRacket, I’m
> guessing that there’s no existing functionality that would allow me to
> specify a list of files and move back and forth between them. I’m guessing
> I could implement something like this pretty easily … would this be a good
> job for Laurent Orseau’s Quickscript?
> >
> > I would absolutely love to hear that I’ve missed something obvious!
> >
> > Many thanks!
> >
> > 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.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net
> .
>
>
>
>

-- 
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/CAE8gKocQ1gLeA6QSqqDWdFV5nQRhrgu0L1bRZxCnr_Hpd32J_A%40mail.gmail.com.


Re: [racket-users] [racket users] struct #:methods question

2020-04-21 Thread David Storrs
On Mon, Apr 20, 2020 at 6:50 PM Jon Zeppieri  wrote:

> There's no trick to it:
>
> #lang racket/base
>
> (require racket/generic)
>
> (define-generics foo
>   (foo-do foo x))
>
> (struct thing (x)
>   #:methods gen:foo
>   [(define (foo-do f x)
>  (thing x))])
>
>
> On Mon, Apr 20, 2020 at 6:32 PM Kevin Forchione  wrote:
> >
> > Hi guys,
> > How do you return an instance of the structure type from the struct’s
> #:methods? This is would seem to be a common situation, but it has me
> stumped.
> >
> > Kevin
>



Note that if you're getting fancy with structs then you might want to check
out: https://docs.racket-lang.org/struct-plus-plus/index.html

Among other things, it auto-generates functional setters and functional
updaters, a keyword constructor, dotted accessors, reflection data, and
allows for contracts on individual fields and enforcement of relationships
between fields.



>
> > --
> > 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/EE404363-995C-4888-8B43-E463EB3C7418%40gmail.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/CAKfDxxx6b2yq6Sn6zzr49oZqGXc5h4CA-Vj%3DVYEkLbmaBOi3Pg%40mail.gmail.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/CAE8gKof3k4GdbTerX-ss2uJCg7jQB2XWvC59P1SKYUbuCnrXgg%40mail.gmail.com.


Re: [racket-users] visit a sequence of files

2020-04-21 Thread 'John Clements' via Racket Users
Well, sure… once you open all the files. Opening all the files is the painful 
part. Also, the display of tabs is not totally great when you have sixty or 
seventy of them open. Sorry, it might not have been clear that I want a list of 
sixty or seventy files.

John

> On Apr 21, 2020, at 1:34 PM, David Storrs  wrote:
> 
> I don't use DrRacket much, but would the normal 'previous / next window' 
> commands work for you?  On Mac it's:
> previous window:  Shft + Cmd + ~
> next window: Cmd + ~ 
> 
> or 
> 
> previous window: Cmd + 
> next window: Cmd + 
> 
> On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users 
>  wrote:
> Here’s a question I have about both DrRacket and Emacs. It often happens in 
> my workflow (grading files, for instance) that I want to set up a list of 
> files, and then have an easy way to move forward or back in that list (“next 
> file”, “previous file”). I see that emacs has a function called “next-file” 
> which can move forward and back in a list of files apparently specified by a 
> tags-table file; is that the easiest way to do something like this in emacs, 
> or am I missing something obvious? In DrRacket, I’m guessing that there’s no 
> existing functionality that would allow me to specify a list of files and 
> move back and forth between them. I’m guessing I could implement something 
> like this pretty easily … would this be a good job for Laurent Orseau’s 
> Quickscript?
> 
> I would absolutely love to hear that I’ve missed something obvious!
> 
> Many thanks!
> 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net.



-- 
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/dd520e71-a33f-4c47-af19-addcdce6f435%40mtasv.net.


Re: [racket-users] visit a sequence of files

2020-04-21 Thread David Storrs
I don't use DrRacket much, but would the normal 'previous / next window'
commands work for you?  On Mac it's:
previous window:  Shft + Cmd + ~
next window: Cmd + ~

or

previous window: Cmd + 
next window: Cmd + 

On Tue, Apr 21, 2020 at 4:29 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:

> Here’s a question I have about both DrRacket and Emacs. It often happens
> in my workflow (grading files, for instance) that I want to set up a list
> of files, and then have an easy way to move forward or back in that list
> (“next file”, “previous file”). I see that emacs has a function called
> “next-file” which can move forward and back in a list of files apparently
> specified by a tags-table file; is that the easiest way to do something
> like this in emacs, or am I missing something obvious? In DrRacket, I’m
> guessing that there’s no existing functionality that would allow me to
> specify a list of files and move back and forth between them. I’m guessing
> I could implement something like this pretty easily … would this be a good
> job for Laurent Orseau’s Quickscript?
>
> I would absolutely love to hear that I’ve missed something obvious!
>
> Many thanks!
>
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net
> .
>

-- 
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/CAE8gKodjBKkjdUE_gzyFZpVVJHd%2BnWYg%3D%2BN4bGKvT9W7ci4e-A%40mail.gmail.com.


[racket-users] visit a sequence of files

2020-04-21 Thread 'John Clements' via Racket Users
Here’s a question I have about both DrRacket and Emacs. It often happens in my 
workflow (grading files, for instance) that I want to set up a list of files, 
and then have an easy way to move forward or back in that list (“next file”, 
“previous file”). I see that emacs has a function called “next-file” which can 
move forward and back in a list of files apparently specified by a tags-table 
file; is that the easiest way to do something like this in emacs, or am I 
missing something obvious? In DrRacket, I’m guessing that there’s no existing 
functionality that would allow me to specify a list of files and move back and 
forth between them. I’m guessing I could implement something like this pretty 
easily … would this be a good job for Laurent Orseau’s Quickscript?

I would absolutely love to hear that I’ve missed something obvious!

Many thanks!

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/38dfc78b-4d01-4ac1-b1cd-2e4b372c2d09%40mtasv.net.


[racket-users] Lightweight, lazy trees (new package)

2020-04-21 Thread Siddhartha Kasivajhula
Hi folks,
Here is a new package providing lightweight, general purpose utilities for
working with tree-structured data:

https://docs.racket-lang.org/lazytree/

It allows you to take any data exhibiting tree structure and lazily
construct a stream representation of it using functions that presumably
already exist in your application, if the data indeed already
possesses tree structure.

The library leverages the corresponding tree structure of nested lists
(streams) to perform standard operations on data that has such structure,
for instance, providing operations analogous to map, filter, and fold, for
trees and with lazy semantics.

The laziness is inherited from the collection utilities in the excellent
data/collection 
library, and more generally, Racket streams
.

Enjoy,
-Sid

-- 
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/CACQBWF%3D5eQCcZZ8rQerNpeuzcxqYUpRxe5wtr1Rx_aSmOCh3JA%40mail.gmail.com.


Re: [racket-users] hash-ref in typed Racket

2020-04-21 Thread Hendrik Boom
On Tue, Apr 21, 2020 at 10:50:44AM -0400, Sam Tobin-Hochstadt wrote:
> The problem here is with the optional third argument to `hash-ref`.
> Typed Racket only allows `#f` or functions as the third argument.
> Plain Racket allows any non-function value as a default, or a function
> which is called to produce the default. Since "any non-function" is
> not expressible in Typed Racket, it's more restricted here.

I missed that.  Thanks.

> 
> The best option is to wrap the third argument in a thunk: `(lambda () 
> 'other)`.
> 
> As an aside, you probably don't want to use `cast` this extensively in
> your program.

No, I don't.  I hoped it would help, but I was fixing the wrong problem, 
so it didn't .

-- hendrik

> 
> Sam
> 
> On Tue, Apr 21, 2020 at 10:35 AM Hendrik Boom  wrote:
> >
> > In typed Racket I define a hashtable:
> >
> > (: vector-to-contract (HashTable TType CContract))
> >
> > (define vector-to-contract
> >   (make-hash
> >(cast '(
> >(_bytes . bytes?)
> >(_s8vector . s8vector?)
> >(_u16vector . u16vector?)
> >(_s16vector . s16vector?)
> >(_u32vector . u32vector?)
> >(_s32vector . s32vector?)
> >(_u64vector . u64vector?)
> >(_s64vector . s64vector?)
> >(_f32vector . f32vector?)
> >(_f64vector . f64vector?))
> >  (Listof (Pair TType CContract))
> >  )
> >))
> >
> > And then I try to look something up in it:
> >
> > ( hash-ref vector-to-contract (cast '_bytes TType) (cast 'other CContract))
> >
> > and I am informed that I cannot, it seems, look up a value of type
> > TType in a hastable whose type indicates it looks up things of type
> > TType:
> >
> > Type Checker: Polymorphic function `hash-ref' could not be applied to 
> > arguments:
> > Types: HashTableTop a (-> c) -> Any
> >HashTableTop a False -> Any
> >HashTableTop a -> Any
> > Arguments: (HashTable TType CContract) TType CContract
> > Expected result: AnyValues
> >  in: (hash-ref vector-to-contract (cast (quote _bytes) TType) (cast
> > (quote other) CContract))
> >
> >
> > How *does* one use hashtables in typed Racket?
> >
> > -- hendrik
> >
> > --
> > 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/20200421143453.lauuqi3pb4fdgyhh%40topoi.pooq.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/CAK%3DHD%2BY-pc3Jfg4RgRmAPMqSUxUj8rJsm3np2eq2%2B-J5PWTO4Q%40mail.gmail.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/20200421163253.ui4xuokcgsprhyna%40topoi.pooq.com.


Re: [racket-users] hash-ref in typed Racket

2020-04-21 Thread Sam Tobin-Hochstadt
The problem here is with the optional third argument to `hash-ref`.
Typed Racket only allows `#f` or functions as the third argument.
Plain Racket allows any non-function value as a default, or a function
which is called to produce the default. Since "any non-function" is
not expressible in Typed Racket, it's more restricted here.

The best option is to wrap the third argument in a thunk: `(lambda () 'other)`.

As an aside, you probably don't want to use `cast` this extensively in
your program.

Sam

On Tue, Apr 21, 2020 at 10:35 AM Hendrik Boom  wrote:
>
> In typed Racket I define a hashtable:
>
> (: vector-to-contract (HashTable TType CContract))
>
> (define vector-to-contract
>   (make-hash
>(cast '(
>(_bytes . bytes?)
>(_s8vector . s8vector?)
>(_u16vector . u16vector?)
>(_s16vector . s16vector?)
>(_u32vector . u32vector?)
>(_s32vector . s32vector?)
>(_u64vector . u64vector?)
>(_s64vector . s64vector?)
>(_f32vector . f32vector?)
>(_f64vector . f64vector?))
>  (Listof (Pair TType CContract))
>  )
>))
>
> And then I try to look something up in it:
>
> ( hash-ref vector-to-contract (cast '_bytes TType) (cast 'other CContract))
>
> and I am informed that I cannot, it seems, look up a value of type
> TType in a hastable whose type indicates it looks up things of type
> TType:
>
> Type Checker: Polymorphic function `hash-ref' could not be applied to 
> arguments:
> Types: HashTableTop a (-> c) -> Any
>HashTableTop a False -> Any
>HashTableTop a -> Any
> Arguments: (HashTable TType CContract) TType CContract
> Expected result: AnyValues
>  in: (hash-ref vector-to-contract (cast (quote _bytes) TType) (cast
> (quote other) CContract))
>
>
> How *does* one use hashtables in typed Racket?
>
> -- hendrik
>
> --
> 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/20200421143453.lauuqi3pb4fdgyhh%40topoi.pooq.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/CAK%3DHD%2BY-pc3Jfg4RgRmAPMqSUxUj8rJsm3np2eq2%2B-J5PWTO4Q%40mail.gmail.com.


[racket-users] hash-ref in typed Racket

2020-04-21 Thread Hendrik Boom
In typed Racket I define a hashtable:

(: vector-to-contract (HashTable TType CContract))

(define vector-to-contract
  (make-hash
   (cast '(
   (_bytes . bytes?)
   (_s8vector . s8vector?)
   (_u16vector . u16vector?)
   (_s16vector . s16vector?)
   (_u32vector . u32vector?)
   (_s32vector . s32vector?)
   (_u64vector . u64vector?)
   (_s64vector . s64vector?)
   (_f32vector . f32vector?)
   (_f64vector . f64vector?))
 (Listof (Pair TType CContract))
 )
   ))

And then I try to look something up in it:

( hash-ref vector-to-contract (cast '_bytes TType) (cast 'other CContract))

and I am informed that I cannot, it seems, look up a value of type 
TType in a hastable whose type indicates it looks up things of type 
TType:

Type Checker: Polymorphic function `hash-ref' could not be applied to arguments:
Types: HashTableTop a (-> c) -> Any
   HashTableTop a False -> Any
   HashTableTop a -> Any
Arguments: (HashTable TType CContract) TType CContract
Expected result: AnyValues
 in: (hash-ref vector-to-contract (cast (quote _bytes) TType) (cast 
(quote other) CContract))


How *does* one use hashtables in typed Racket?

-- hendrik

-- 
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/20200421143453.lauuqi3pb4fdgyhh%40topoi.pooq.com.


[racket-users] editor-canvas% questions

2020-04-21 Thread Emma Borhanian
Hi if I have a simple editor-canvas% with text% in it:
(define editor-canvas (new  editor-canvas% [parent frame]))
(define text (new text%))
(send editor-canvas set-editor text)

1. How do I make the standard right click menu with copy, paste, etc.?

I've seen this example of a custom popup menu:
https://github.com/soegaard/bracket/blob/master/gui/racket-cas.rkt#L351
But is there some shorthand for making the standard copy/paste popup?

2. I can add "Edit" and "Font" to the menu bar like this:
(define mb (new menu-bar% [parent frame]))
(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)

In Mac OS this isn't leading to the menu bar flashing blue when I use 
keyboard shortcuts like ⌘c. How can I fix this? I notice DrRacket itself 
has the same bug. This is important for discoverability.

3. How do I do a bulleted list? Should I be using this snip in the browser 
lib? 
https://github.com/racket/drracket/blob/master/drracket/browser/private/bullet.rkt

-- 
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/f0f46057-7f57-4b96-9be3-7b356eec2f6a%40googlegroups.com.