Re: [racket-users] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread David Christiansen
Hi Meino,

> ... the resulting file was 46x times bigger than the input.
> This is little to much for a flash based budget tablet...;)
> Any idea to circumeven this?

Unfortunately not. I typically just print the resulting file.

Good luck!

/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] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread Meino . Cramer
Hi David,

thanks for your reply! :)

I installed pdfcrop and processd "reference.pdf" with it like so:
pdfcrop --verbose reference.pdf reference.cropped.pdf

The result was without any margin (this was only a testrun!):
-rw-r--r-- 1 mccramer users   3070399 2016-11-06 04:30 reference.pdf
-rw-r--r-- 1 mccramer users 141998926 2016-11-06 04:35 reference.cropped.pdf
But a little calculation
solfire:pdf/resized>bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
141998926/3070399
46.24771112809768372123

shows, that the resulting file was 46x times bigger than the input.
This is little to much for a flash based budget tablet...;)
Any idea to circumeven this?

Cheers
Meino




David Christiansen  [16-11-06 03:33]:
> Hello,
> 
> > Is there a (simple) way to get rid of most
> > of the white blank border and to create
> > the pdfs in a differen page format (aspect
> > ratio) ?
> 
> I often use a little command-line utility called pdfcrop to remove margins
> from PDF files. It's also useful for economical printing of long texts,
> because printing 2 pages per side has less wasted space.
> 
> /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] Building regexen in at-exp

2016-11-05 Thread Eli Barzilay
On Fri, Oct 28, 2016 at 3:18 PM, David Storrs  wrote:
> tl;dr :  Why is the following an error?
>
> #lang at-exp racket
> (define a "this")
> @pregexp{^@a}  ;; Should produce #px"^this" but errors out
> @pregexp{@(~a "^" a)}  ;; This works but is clumsy

I see that the problem was pointed to you several times, but I didn't
see suggestions for a convenient replacement.  I often have something
like this:

#lang at-exp racket
(define px (compose pregexp string-append))   ; <--- like this
(define a "this")
@px{^@a}  ; works fine, and looks like a variant of #px"..."


[[ You can also do this for a one-time-use:

@(compose pregexp string-append){^@a}

but that's almost as bad as one of

@pregexp{@string-append{^@a}}
@pregexp[@string-append{^@a}]
(pregexp @string-append{^@a})

]]

-- 
   ((x=>x(x))(x=>x(x)))  Eli Barzilay:
   http://barzilay.org/  Maze is Life!

-- 
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] Of editors and mere mortals

2016-11-05 Thread Vincent St-Amour
There's a section of the guide that discusses tools to use Racket with
various text editors, including Emacs:

http://docs.racket-lang.org/guide/other-editors.html

Vincent



On Sat, 05 Nov 2016 08:14:34 -0500,
Ken MacKenzie wrote:
> 
> So as much as I know there is much love for Dr Racket, I am not the biggest 
> fan.  Yes I must admit some of its helper features are great for working in 
> racket and if I must debug something it is probably the best place to work.
> 
> Anyway was wondering what other editors people use.  I have been a vim user 
> for a while.  Lately navigating away from it for more IDE like tasks.  I have 
> found VS code on linux to actually be a pretty good racket environment with 
> the drracket plugin available for it.
> 
> My latest love is I have started to get into emacs.  Years ago I tried it and 
> didn't see the advantage over vim.  Now having been coding in racket, elisp 
> looks less like annoying voodoo to me.  Also I am finding all the things one 
> can do within emacs that are outside the scope of editing to be handy.
> 
> Anyway just curious what other editors people use.  And particularly if you 
> use emacs, what add ons or setup do you do for racket or scheme editing in 
> general.
> 
> Ken
> 
> -- 
> 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] Why would delete-file fail without throwing?

2016-11-05 Thread 'John Clements' via Racket Users

> On Nov 5, 2016, at 15:05, David Storrs  wrote:
> 
> I've got this little snip of code:  
> 
> 
> (define p "/tmp/foo/bar-28")
> (file-exists? p)  ; #t
> (delete-file p)
> (file-exists? p)  ; still #t  ??
> 
> 
> I've verified that:
> 
> *) It's not throwing an exception
> *) The code is running as me
> *) The /tmp directory is 777  [I'm on OSX 10.11]
> *) The file itself is 666, although that shouldn't matter
> *) The file is owned by me
> *) p is a string
> *) p points to the correct file
> *) There are no leading or trailing whitespace characters
> *) If I run this code from inside a command-line Racket REPL, it works fine 
> and the file is deleted
> *) If I replace (delete-file) with (system @~a{rm -f @p}) it works fine

Four things occur to me:

1) you say that it works in command-line Racket, but you don’t say where it 
doesn’t work. Is it in the DrR interactions window? As part of a module? Does 
it work if you put it in a module (that is, a file starting with #lang) and run 
it from the command-line?
2) The “-f” in your system command makes me curious. Why should the -f be 
necessary?
3) delete-file is documented to raise an exception if it doesn’t succeed. I’m 
assuming this isn’t happening?
4) In principle, it’s possible that some other process is creating the file 
again between your call to delete-file and the call to file-exists?. Seems 
unlikely, yes. 

John

> 
> I thought maybe there was something weird about the /tmp directory, so I 
> tried putting the target in a different directory 
> (/Users/dstorrs/tmp/foo/bar-28) but that made no difference.
> 
> I've tried googling on the general net and in the mailing list archives and 
> found nothing.  I am utterly flummoxed here; can anyone suggest anything?
> 
> 
> 
> -- 
> 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] docs for string-trim

2016-11-05 Thread Eli Barzilay
On Wed, Nov 2, 2016 at 12:29 AM, Ben Greenman
 wrote:
> The trick is that 'whitespace' isn't just #\space. It's any sequence
> of whitespace characters, like "\r\r\r" or " \r\n\t"

...and this happens because the default `sep` is a regexp, not a plain
string.

-- 
   ((x=>x(x))(x=>x(x)))  Eli Barzilay:
   http://barzilay.org/  Maze is Life!

-- 
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] Of editors and mere mortals

2016-11-05 Thread Ken M
Yes racket mode is installed.  A few other odds and ends as well.

A few other people direct responded some other suggestions.  I would
suggest they add them to the whole group as they might prove useful for
others.

Ken

On Sat, Nov 05, 2016 at 01:58:48PM -0400, Ben Greenman wrote:
> Do you have racket-mode installed?
> https://github.com/greghendershott/racket-mode

-- 
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] Why would delete-file fail without throwing?

2016-11-05 Thread Matthias Felleisen

I am on 10.11 and almost git head. I cannot repeat your experiment. Is the 
following accurate? 

% cat /tmp/foo.txt
hello world
good bye 
% racket 
Welcome to Racket v6.7.0.3.
> (define p "/tmp/foo.txt")
> (file-exists? p)
#t
> (delete-file p)
> (file-exists? p)
#f



> On Nov 5, 2016, at 6:05 PM, David Storrs  wrote:
> 
> I've got this little snip of code:  
> 
> 
> (define p "/tmp/foo/bar-28")
> (file-exists? p)  ; #t
> (delete-file p)
> (file-exists? p)  ; still #t  ??
> 
> 
> I've verified that:
> 
> *) It's not throwing an exception
> *) The code is running as me
> *) The /tmp directory is 777  [I'm on OSX 10.11]
> *) The file itself is 666, although that shouldn't matter
> *) The file is owned by me
> *) p is a string
> *) p points to the correct file
> *) There are no leading or trailing whitespace characters
> *) If I run this code from inside a command-line Racket REPL, it works fine 
> and the file is deleted
> *) If I replace (delete-file) with (system @~a{rm -f @p}) it works fine
> 
> I thought maybe there was something weird about the /tmp directory, so I 
> tried putting the target in a different directory 
> (/Users/dstorrs/tmp/foo/bar-28) but that made no difference.
> 
> I've tried googling on the general net and in the mailing list archives and 
> found nothing.  I am utterly flummoxed here; can anyone suggest anything?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

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


[racket-users] Why would delete-file fail without throwing?

2016-11-05 Thread David Storrs
I've got this little snip of code:


(define p "/tmp/foo/bar-28")
(file-exists? p)  ; #t
(delete-file p)
(file-exists? p)  ; still #t  ??


I've verified that:

*) It's not throwing an exception
*) The code is running as me
*) The /tmp directory is 777  [I'm on OSX 10.11]
*) The file itself is 666, although that shouldn't matter
*) The file is owned by me
*) p is a string
*) p points to the correct file
*) There are no leading or trailing whitespace characters
*) If I run this code from inside a command-line Racket REPL, it works fine
and the file is deleted
*) If I replace (delete-file) with (system @~a{rm -f @p}) it works fine

I thought maybe there was something weird about the /tmp directory, so I
tried putting the target in a different directory
(/Users/dstorrs/tmp/foo/bar-28) but that made no difference.

I've tried googling on the general net and in the mailing list archives and
found nothing.  I am utterly flummoxed here; can anyone suggest anything?

-- 
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] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread David Christiansen
Hello,

> Is there a (simple) way to get rid of most
> of the white blank border and to create
> the pdfs in a differen page format (aspect
> ratio) ?

I often use a little command-line utility called pdfcrop to remove margins
from PDF files. It's also useful for economical printing of long texts,
because printing 2 pages per side has less wasted space.

/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] The regex and me...

2016-11-05 Thread David Storrs
On Sat, Nov 5, 2016 at 10:00 AM,  wrote:

>
> Hi David,
>
> thanks for your reply ! :)
>
> SUPER! THAT helps!
>
> Is this kinda "pattern", that
> if 'function' does something once, there is a
> 'function*' that does the same thing multiple times?
>
> Cheers
> Meino
>
>
It depends on your definitions.  Many Racket functions are variadic,
meaning they can take an arbitrary number of arguments.  For example, if
you want to add several numbers together, you do this:

Most languages:   2 + 3 + 4 + 5

Racket:  (+ 2 3 4 5)

You could interpret this as doing something multiple times, I suppose.  In
general, no.  There is not always a 'foo*' function that does 'foo'
multiple times.


>
>
> David Storrs  [16-11-05 14:37]:
> > (regexp-match* #px"(AA.+?AA)" str)
> >
> >
> > regexp-match* matches multiple times through the string.
> >
> > As with Perl and pcre in general, a trailing '?' makes quantifers
> > non-greedy.
> >
> >
> >
> > On Sat, Nov 5, 2016 at 8:59 AM,  wrote:
> >
> > > Hi Jens,
> > >
> > > thanks for your reply! :)
> > >
> > > ...hmmm...I /think/ I understand the mechanism now...but
> > > if it is as it seems to be...I run into another problem.
> > >
> > > Suppose your have a long line of character with groups
> > > of certain chararcter and random caharcters in between.
> > >
> > > Something like this
> > > SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDL
> > > SJDLAAJENSAASJHDKASHDK
> > >
> > > The pattern here is .
> > >
> > > The first idea, which came into my mind would be to match with
> > > something like
> > >
> > > (regex-match rx#"(AA[A-Z]+AA))
> > >
> > > (beside the fact, that I currently dont know, how to match non
> > > greedily): The guide says:
> > >
> > >
> > > > (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> > >
> > > '("lather; rinse; repeat;" " repeat;")
> > >
> > > Here, the *-quantified subpattern matches three times, but it is
> the
> > > last submatch that is returned.
> > >
> > > So I would get back AAJENSAA and AAMEINOAA would be matched but not
> > > included in the list of matched strings.
> > >
> > > If the line is of unknown length as the count of "" groups
> > > is, I would not know how to cope with this?
> > >
> > > Is there any other way to get back a list of all found matches instead
> > > of only he last one?
> > >
> > > Thank you very much in advance for any help!
> > > Cheers
> > > Meino
> > >
> > >
> > >
> > >
> > > Jens Axel Søgaard  [16-11-04 20:28]:
> > > > The first result string is the first matched string. The second
> result
> > > is what was matched by the sub expression in the parenthesis.
> > > >
> > > >
> > > > > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > > > >
> > > > > Hi,
> > > > >
> > > > > Normally I would tend to think, that I am
> > > > > quite familiar with regex and their usage
> > > > > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > > > >
> > > > > Then I played a little with regex-match...and
> > > > > I have to go to school again..,,
> > > > >
> > > > > From the Racket guide:
> > > > >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> > > > > '("lather; rinse; repeat;" " repeat;")
> > > > >
> > > > > [a-z ]: matches one lowercase character of the range of a-z and the
> > > #\space
> > > > > + : the above one ore more times
> > > > > ; : followed by a ';'
> > > > > (): all the above grouped
> > > > > * : 0 or more times
> > > > > seems obvious..
> > > > >
> > > > > But the result is not (at least for me... ;)
> > > > > '("lather; rinse; repeat;" " repeat;")
> > > > >
> > > > > I understand "lather; rinse; repeat;" as match -
> > > > > it reflects the "greedy behaviour" of regex.
> > > > >
> > > > > But " repeat;" ???
> > > > >
> > > > > Why not "rinse; repeat;" then???
> > > > >
> > > > > I am buffled...
> > > > >
> > > > > (help!)+
> > > > >
> > > > > :)
> > > > >
> > > > > (Thank you)+ (much)+ in advance!
> > > > > Cheers
> > > > > Meino
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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 

Re: [racket-users] Of editors and mere mortals

2016-11-05 Thread Ben Greenman
Do you have racket-mode installed?
https://github.com/greghendershott/racket-mode

-- 
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] Meta-question: "Racket to go"andtheformatofthedocumentation...

2016-11-05 Thread Meino . Cramer

Hi,

I put Racket on different computers and tablets.
So my 7" tablet receives a copy fo Racket :)

But:
The pdfs of the documentation 
have a wide blank border and a ratio aspect,
which is different of that of the tablet.
When viewing the pdfs with mudf, it (mupdf)
tries to disply "the whole page" on the screen,
which in turn results in a very tiny words.
Zooming is not really a solution, since
pageflipping is only avaiable, when the
whole page is displayed.

Is there a (simple) way to get rid of most
of the white blank border and to create
the pdfs in a differen page format (aspect
ratio) ?

Thanks a lot for any help in advance!
Cheers
Meino



-- 
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] Extending DrRacket's LaTeX Shortcuts

2016-11-05 Thread Laurent
There's no official package. It's probably best to just dump the contents
of this file into the existing one. Btw, I think this file should probably
not belong to "gui", but it may be cumbersome to move it to a different
place I guess.


On Sat, Nov 5, 2016 at 3:49 PM, Robby Findler 
wrote:

> I think it would be great to adjust the one that DrRacket uses to use
> this one. Is that in a pkg somewhere? Or would it be better to just
> drop it into the existing one?
>
> Robby
>
>
> On Sat, Nov 5, 2016 at 7:31 AM, Laurent  wrote:
> > This may be of interest:
> > https://gist.github.com/Metaxal/86be1b733c0f5ad4a0cf6c58cf140436
> >
> > It's a assoc list between latex math strings and unicode characters.
> >
> > This list is based on
> > "anaconda/lib/python2.7/site-packages/docutils/utils/math/
> tex2unichar.py"
> > itself based on
> > http://milde.users.sourceforge.net/LUCR/Math/
> >
> > HTH,
> > Laurent
> >
> > On Fri, Nov 4, 2016 at 7:50 PM, Vincent St-Amour
> >  wrote:
> >>
> >> Hi Kelly,
> >>
> >> The table's source is there:
> >>
> >> https://github.com/racket/gui/blob/master/tex-table/tex-table.rkt
> >>
> >> It doesn't look like the list is user-extensible, but you can extend it
> >> by modifying the file.
> >>
> >> To do so, you'd want to update the `tex-table` package to use a
> >> from-source version (from the directory where you'd like the code to
> be):
> >>
> >> raco pkg update --clone tex-table
> >>
> >> Then, add the characters you want to the table, then run `raco setup` to
> >> recompile the package.
> >>
> >> You may also want to consider submitting a pull request on Github, to
> >> merge your changes with mainline Racket. You can do this either by
> >> cloning the `racket/gui` repoon github, then pushing your changes (if
> >> you know git), or using Github's own browser-based editor.
> >>
> >> Vincent
> >>
> >>
> >>
> >> On Fri, 04 Nov 2016 20:23:05 +0100,
> >> Kelly Smith wrote:
> >> >
> >> > I've been learning Racket for awhile now (it's the first language I've
> >> > seriously pursued), and I can usually fumble together what I need for
> small
> >> > projects. However, lately I've been working with Pollen, and my
> documents
> >> > call for a lot of math symbols. I'm wondering if there's a reasonable
> way to
> >> > extend DrRacket's `M-\` LaTeX shortcuts (e.g. `\sum` -> ∑, ). I
> have no
> >> > experience with this kind of thing.
> >> >
> >> > I've investigated the keybindings, and found that `M-\` is bound to a
> >> > function/command called "TeX Compress". I can't seem to find out
> anything
> >> > more than that. I've even looked through the sources for DrRacket on
> GitHub,
> >> > but no luck.
> >> >
> >> > I have no idea if this is a reasonable/tractable objective, but I'll
> >> > gladly learn what I need to work on it; I'm just a little lost at the
> >> > moment.
> >> >
> >> > --
> >> > 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.
>
> --
> 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] Extending DrRacket's LaTeX Shortcuts

2016-11-05 Thread Robby Findler
I think it would be great to adjust the one that DrRacket uses to use
this one. Is that in a pkg somewhere? Or would it be better to just
drop it into the existing one?

Robby


On Sat, Nov 5, 2016 at 7:31 AM, Laurent  wrote:
> This may be of interest:
> https://gist.github.com/Metaxal/86be1b733c0f5ad4a0cf6c58cf140436
>
> It's a assoc list between latex math strings and unicode characters.
>
> This list is based on
> "anaconda/lib/python2.7/site-packages/docutils/utils/math/tex2unichar.py"
> itself based on
> http://milde.users.sourceforge.net/LUCR/Math/
>
> HTH,
> Laurent
>
> On Fri, Nov 4, 2016 at 7:50 PM, Vincent St-Amour
>  wrote:
>>
>> Hi Kelly,
>>
>> The table's source is there:
>>
>> https://github.com/racket/gui/blob/master/tex-table/tex-table.rkt
>>
>> It doesn't look like the list is user-extensible, but you can extend it
>> by modifying the file.
>>
>> To do so, you'd want to update the `tex-table` package to use a
>> from-source version (from the directory where you'd like the code to be):
>>
>> raco pkg update --clone tex-table
>>
>> Then, add the characters you want to the table, then run `raco setup` to
>> recompile the package.
>>
>> You may also want to consider submitting a pull request on Github, to
>> merge your changes with mainline Racket. You can do this either by
>> cloning the `racket/gui` repoon github, then pushing your changes (if
>> you know git), or using Github's own browser-based editor.
>>
>> Vincent
>>
>>
>>
>> On Fri, 04 Nov 2016 20:23:05 +0100,
>> Kelly Smith wrote:
>> >
>> > I've been learning Racket for awhile now (it's the first language I've
>> > seriously pursued), and I can usually fumble together what I need for small
>> > projects. However, lately I've been working with Pollen, and my documents
>> > call for a lot of math symbols. I'm wondering if there's a reasonable way 
>> > to
>> > extend DrRacket's `M-\` LaTeX shortcuts (e.g. `\sum` -> ∑, ). I have no
>> > experience with this kind of thing.
>> >
>> > I've investigated the keybindings, and found that `M-\` is bound to a
>> > function/command called "TeX Compress". I can't seem to find out anything
>> > more than that. I've even looked through the sources for DrRacket on 
>> > GitHub,
>> > but no luck.
>> >
>> > I have no idea if this is a reasonable/tractable objective, but I'll
>> > gladly learn what I need to work on it; I'm just a little lost at the
>> > moment.
>> >
>> > --
>> > 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.

-- 
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] The regex and me...

2016-11-05 Thread Meino . Cramer

Hi David,

thanks for your reply ! :)

SUPER! THAT helps!

Is this kinda "pattern", that 
if 'function' does something once, there is a 
'function*' that does the same thing multiple times?

Cheers
Meino




David Storrs  [16-11-05 14:37]:
> (regexp-match* #px"(AA.+?AA)" str)
> 
> 
> regexp-match* matches multiple times through the string.
> 
> As with Perl and pcre in general, a trailing '?' makes quantifers
> non-greedy.
> 
> 
> 
> On Sat, Nov 5, 2016 at 8:59 AM,  wrote:
> 
> > Hi Jens,
> >
> > thanks for your reply! :)
> >
> > ...hmmm...I /think/ I understand the mechanism now...but
> > if it is as it seems to be...I run into another problem.
> >
> > Suppose your have a long line of character with groups
> > of certain chararcter and random caharcters in between.
> >
> > Something like this
> > SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDL
> > SJDLAAJENSAASJHDKASHDK
> >
> > The pattern here is .
> >
> > The first idea, which came into my mind would be to match with
> > something like
> >
> > (regex-match rx#"(AA[A-Z]+AA))
> >
> > (beside the fact, that I currently dont know, how to match non
> > greedily): The guide says:
> >
> >
> > > (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> >
> > '("lather; rinse; repeat;" " repeat;")
> >
> > Here, the *-quantified subpattern matches three times, but it is the
> > last submatch that is returned.
> >
> > So I would get back AAJENSAA and AAMEINOAA would be matched but not
> > included in the list of matched strings.
> >
> > If the line is of unknown length as the count of "" groups
> > is, I would not know how to cope with this?
> >
> > Is there any other way to get back a list of all found matches instead
> > of only he last one?
> >
> > Thank you very much in advance for any help!
> > Cheers
> > Meino
> >
> >
> >
> >
> > Jens Axel Søgaard  [16-11-04 20:28]:
> > > The first result string is the first matched string. The second result
> > is what was matched by the sub expression in the parenthesis.
> > >
> > >
> > > > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > > >
> > > > Hi,
> > > >
> > > > Normally I would tend to think, that I am
> > > > quite familiar with regex and their usage
> > > > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > > >
> > > > Then I played a little with regex-match...and
> > > > I have to go to school again..,,
> > > >
> > > > From the Racket guide:
> > > >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> > > > '("lather; rinse; repeat;" " repeat;")
> > > >
> > > > [a-z ]: matches one lowercase character of the range of a-z and the
> > #\space
> > > > + : the above one ore more times
> > > > ; : followed by a ';'
> > > > (): all the above grouped
> > > > * : 0 or more times
> > > > seems obvious..
> > > >
> > > > But the result is not (at least for me... ;)
> > > > '("lather; rinse; repeat;" " repeat;")
> > > >
> > > > I understand "lather; rinse; repeat;" as match -
> > > > it reflects the "greedy behaviour" of regex.
> > > >
> > > > But " repeat;" ???
> > > >
> > > > Why not "rinse; repeat;" then???
> > > >
> > > > I am buffled...
> > > >
> > > > (help!)+
> > > >
> > > > :)
> > > >
> > > > (Thank you)+ (much)+ in advance!
> > > > Cheers
> > > > Meino
> > > >
> > > >
> > > >
> > > > --
> > > > 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.
> >
> 
> -- 
> 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] The regex and me...

2016-11-05 Thread David Storrs
(regexp-match* #px"(AA.+?AA)" str)


regexp-match* matches multiple times through the string.

As with Perl and pcre in general, a trailing '?' makes quantifers
non-greedy.



On Sat, Nov 5, 2016 at 8:59 AM,  wrote:

> Hi Jens,
>
> thanks for your reply! :)
>
> ...hmmm...I /think/ I understand the mechanism now...but
> if it is as it seems to be...I run into another problem.
>
> Suppose your have a long line of character with groups
> of certain chararcter and random caharcters in between.
>
> Something like this
> SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDL
> SJDLAAJENSAASJHDKASHDK
>
> The pattern here is .
>
> The first idea, which came into my mind would be to match with
> something like
>
> (regex-match rx#"(AA[A-Z]+AA))
>
> (beside the fact, that I currently dont know, how to match non
> greedily): The guide says:
>
>
> > (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
>
> '("lather; rinse; repeat;" " repeat;")
>
> Here, the *-quantified subpattern matches three times, but it is the
> last submatch that is returned.
>
> So I would get back AAJENSAA and AAMEINOAA would be matched but not
> included in the list of matched strings.
>
> If the line is of unknown length as the count of "" groups
> is, I would not know how to cope with this?
>
> Is there any other way to get back a list of all found matches instead
> of only he last one?
>
> Thank you very much in advance for any help!
> Cheers
> Meino
>
>
>
>
> Jens Axel Søgaard  [16-11-04 20:28]:
> > The first result string is the first matched string. The second result
> is what was matched by the sub expression in the parenthesis.
> >
> >
> > > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > >
> > > Hi,
> > >
> > > Normally I would tend to think, that I am
> > > quite familiar with regex and their usage
> > > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > >
> > > Then I played a little with regex-match...and
> > > I have to go to school again..,,
> > >
> > > From the Racket guide:
> > >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")
> > > '("lather; rinse; repeat;" " repeat;")
> > >
> > > [a-z ]: matches one lowercase character of the range of a-z and the
> #\space
> > > + : the above one ore more times
> > > ; : followed by a ';'
> > > (): all the above grouped
> > > * : 0 or more times
> > > seems obvious..
> > >
> > > But the result is not (at least for me... ;)
> > > '("lather; rinse; repeat;" " repeat;")
> > >
> > > I understand "lather; rinse; repeat;" as match -
> > > it reflects the "greedy behaviour" of regex.
> > >
> > > But " repeat;" ???
> > >
> > > Why not "rinse; repeat;" then???
> > >
> > > I am buffled...
> > >
> > > (help!)+
> > >
> > > :)
> > >
> > > (Thank you)+ (much)+ in advance!
> > > Cheers
> > > Meino
> > >
> > >
> > >
> > > --
> > > 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.
>

-- 
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] Of editors and mere mortals

2016-11-05 Thread Ken MacKenzie
So as much as I know there is much love for Dr Racket, I am not the biggest 
fan.  Yes I must admit some of its helper features are great for working in 
racket and if I must debug something it is probably the best place to work.

Anyway was wondering what other editors people use.  I have been a vim user for 
a while.  Lately navigating away from it for more IDE like tasks.  I have found 
VS code on linux to actually be a pretty good racket environment with the 
drracket plugin available for it.

My latest love is I have started to get into emacs.  Years ago I tried it and 
didn't see the advantage over vim.  Now having been coding in racket, elisp 
looks less like annoying voodoo to me.  Also I am finding all the things one 
can do within emacs that are outside the scope of editing to be handy.

Anyway just curious what other editors people use.  And particularly if you use 
emacs, what add ons or setup do you do for racket or scheme editing in general.

Ken

-- 
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] The regex and me...

2016-11-05 Thread Meino . Cramer
Hi Jens,

thanks for your reply! :)

...hmmm...I /think/ I understand the mechanism now...but
if it is as it seems to be...I run into another problem.

Suppose your have a long line of character with groups
of certain chararcter and random caharcters in between.

Something like this
SHDKJSHKDAHSKJDHSKAABBBAAAKAJSHDOQWDASLDLAAAMEINOAAJASLAKJDLSJDLAAJENSAASJHDKASHDK

The pattern here is .

The first idea, which came into my mind would be to match with
something like

(regex-match rx#"(AA[A-Z]+AA))

(beside the fact, that I currently dont know, how to match non
greedily): The guide says:


> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")

'("lather; rinse; repeat;" " repeat;")

Here, the *-quantified subpattern matches three times, but it is the last 
submatch that is returned.

So I would get back AAJENSAA and AAMEINOAA would be matched but not
included in the list of matched strings.

If the line is of unknown length as the count of "" groups
is, I would not know how to cope with this?

Is there any other way to get back a list of all found matches instead
of only he last one?

Thank you very much in advance for any help!
Cheers
Meino




Jens Axel Søgaard  [16-11-04 20:28]:
> The first result string is the first matched string. The second result is 
> what was matched by the sub expression in the parenthesis.
> 
> 
> > Den 4. nov. 2016 kl. 20.04 skrev meino.cra...@gmx.de:
> > 
> > Hi,
> > 
> > Normally I would tend to think, that I am 
> > quite familiar with regex and their usage
> > (background: UNIX?Linux, sed, vi/vim, Perl...)
> > 
> > Then I played a little with regex-match...and
> > I have to go to school again..,,
> > 
> > From the Racket guide:
> >> (regexp-match #rx"([a-z ]+;)*" "lather; rinse; repeat;")  
> > '("lather; rinse; repeat;" " repeat;")
> > 
> > [a-z ]: matches one lowercase character of the range of a-z and the #\space
> > + : the above one ore more times
> > ; : followed by a ';'
> > (): all the above grouped 
> > * : 0 or more times
> > seems obvious..
> > 
> > But the result is not (at least for me... ;)
> > '("lather; rinse; repeat;" " repeat;")
> > 
> > I understand "lather; rinse; repeat;" as match -
> > it reflects the "greedy behaviour" of regex.
> > 
> > But " repeat;" ???
> > 
> > Why not "rinse; repeat;" then???
> > 
> > I am buffled...
> > 
> > (help!)+
> > 
> > :)
> > 
> > (Thank you)+ (much)+ in advance!
> > Cheers
> > Meino
> > 
> > 
> > 
> > -- 
> > 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] Extending DrRacket's LaTeX Shortcuts

2016-11-05 Thread Laurent
This may be of interest:
https://gist.github.com/Metaxal/86be1b733c0f5ad4a0cf6c58cf140436

It's a assoc list between latex math strings and unicode characters.

This list is based on
"anaconda/lib/python2.7/site-packages/docutils/utils/math/tex2unichar.py"
itself based on
http://milde.users.sourceforge.net/LUCR/Math/

HTH,
Laurent

On Fri, Nov 4, 2016 at 7:50 PM, Vincent St-Amour <
stamo...@eecs.northwestern.edu> wrote:

> Hi Kelly,
>
> The table's source is there:
>
> https://github.com/racket/gui/blob/master/tex-table/tex-table.rkt
>
> It doesn't look like the list is user-extensible, but you can extend it
> by modifying the file.
>
> To do so, you'd want to update the `tex-table` package to use a
> from-source version (from the directory where you'd like the code to be):
>
> raco pkg update --clone tex-table
>
> Then, add the characters you want to the table, then run `raco setup` to
> recompile the package.
>
> You may also want to consider submitting a pull request on Github, to
> merge your changes with mainline Racket. You can do this either by
> cloning the `racket/gui` repoon github, then pushing your changes (if
> you know git), or using Github's own browser-based editor.
>
> Vincent
>
>
>
> On Fri, 04 Nov 2016 20:23:05 +0100,
> Kelly Smith wrote:
> >
> > I've been learning Racket for awhile now (it's the first language I've
> seriously pursued), and I can usually fumble together what I need for small
> projects. However, lately I've been working with Pollen, and my documents
> call for a lot of math symbols. I'm wondering if there's a reasonable way
> to extend DrRacket's `M-\` LaTeX shortcuts (e.g. `\sum` -> ∑, ). I have
> no experience with this kind of thing.
> >
> > I've investigated the keybindings, and found that `M-\` is bound to a
> function/command called "TeX Compress". I can't seem to find out anything
> more than that. I've even looked through the sources for DrRacket on
> GitHub, but no luck.
> >
> > I have no idea if this is a reasonable/tractable objective, but I'll
> gladly learn what I need to work on it; I'm just a little lost at the
> moment.
> >
> > --
> > 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.