Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Martin DeMello
I do like the second form better, especially since the actual code being
run is not obscured by simply being the last argument to a long log
function.

martin

On Thu, Sep 2, 2021 at 1:55 PM David Storrs  wrote:

> I often find that for debugging I want to see a log message saying "I'm
> about to do X" followed by X followed by "I'm done with X" and I want it to
> return the result of X.
>
> I wrote this macro and posted it to the package server:
> https://pkgs.racket-lang.org/package/log-bracketed
>
> In retrospect, the syntax is bad and I should change it.  Can anyone
> suggest something better?
>
>   (define (on-complete x) (log-test-debug "entering on-complete") x)
>   (struct person (name) #:transparent)
>
>   (log-bracketed test-debug "on-complete" "time: ~a" (current-seconds) 
> (on-complete (person 'bob)))
>   (log-bracketed test-debug "on-complete" "" "no user-specified logging 
> information")
>
> Spits out:
>
>
> test: about to on-complete. time: 1630611613
> test: entering on-complete
> test: after on-complete. time: 1630611613. result: (person 'bob)
> (person 'bob)
> test: about to on-complete
> test: after on-complete. result: "no user-specified logging information"
> "no user-specified logging information"
>
>
> The problem is that this looks like it's a simple logging message when in
> fact it's real code that should not be ignored.  I'm trying to think of a
> better way to do it...maybe something like this?:
>
>   (with-bracketing-logs ([test-debug "on-complete" "time: ~a" 
> (current-seconds)])
>
>  (on-complete (person 'bob))
>
>
>
> --
> 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/CAE8gKocZha-NpiFAAKT1c8QTG3MDFRnvxCD4T0P269EncZW3KQ%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/CAFrFfuEqt1NVjE2Ft1JVArvWnKUBvK7jPVoLqPhYCd-dB00A3Q%40mail.gmail.com.


Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Martin DeMello
Nice, I'll be following this with interest! What are the pros and cons of
developing a new syntax highlighting format from scratch, versus e.g.
parsing and reusing the kate style files? For the latter route this haskell
package is a good source of inspiration:
https://hackage.haskell.org/package/skylighting

martin

On Tue, Feb 18, 2020 at 10:27 AM Sage Gerard  wrote:

> Hi folks,
>
> I'm starting a syntax highlighter project here:
> https://github.com/zyrolasting/syntax-highlighting
>
> There seems to be a precedent for using an existing highlighter from
> another ecosystem. I understand the pragmatism behind that, but a syntax
> highlighter seems to me a missing battery in Racket.
>
> Without funding I am unable to compete with the implementations with 200+
> languages supported. So I merely intend to provide two renderers (Terminal
> and HTML [XML syntax]), some palettes, and a sensible extension to parsack
> that classifies characters using Pygments' token classes. This should
> provide a strong, familiar core on which to add features according to
> community interest.
>
> That being said, I invite feedback and collaboration to add support for
> languages once the core mechanisms are established.
>
> *~slg*
>
>
> --
> 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/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.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/CAFrFfuEgrVdj8hB947%3DOZo2EEVyxO8s%2B%3DQnUjBndHst1S2a25w%40mail.gmail.com.


Re: [racket-users] Re: GUI (get-directory)

2019-11-22 Thread Martin DeMello
One helpful thing to do is expand the GUI section of awesome-racket
https://github.com/avelino/awesome-racket

I just sent them a PR for GUI-helpers.

martin

On Thu, Nov 21, 2019 at 9:21 AM James Platt  wrote:

>
> On Nov 20, 2019, at 3:31 AM, Jack Firth wrote:
>
> > Would it have helped if the get-directory documentation had included
> examples? Many parts of Racket's documentation are lacking in example code,
> especially the less-commonly-encountered parts.
>
> Indeed, I have previously mentioned the lack of examples as a general
> problem.  However, many potential examples may already be written in the
> form of test code.  There is a way to add a sandbox to Scribble which
> allows you to write test code and documentation at the same time.  It would
> be great if this could be made easier to set up and then promoted for wider
> use.  One place where it has been used is the struct++ package.
>
> See:
> https://docs.racket-lang.org/struct-plus-plus/index.html
>
> https://github.com/dstorrs/struct-plus-plus/blob/master/scribblings/struct-plus-plus.scrbl
>
> Also, as David Storrs has mentioned, it would be good if we can find a way
> to make it easier for more people to contribute to the documentation.  See,
> for example, the thread "Wanted: Easier way to contribute docs" on this
> forum from June of 2017.
>
> If we can direct more of the energy of this community into, not just
> improving the documentation, but the way we do documentation, it would be a
> major improvement.  Requiring lots of parentheses doesn't bother me.  Lack
> of infix notation doesn't bother me.  Lack of documentation does.
>
> James
>
> --
> 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/934E0BEE-5840-4596-975F-410C3770DBA6%40biomantica.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/CAFrFfuEd7b3Y_aQ5rHq32tDE_iR06nrJp2J1RRaDsWaYKBhpkg%40mail.gmail.com.


Re: [racket-users] What is the best way to display styled text in a Racket GUI app?

2019-11-12 Thread Martin DeMello
I just figured this out for my current project; I'm not sure it's the best
way but it's a working way :) I have a subclass of text% that mixes in
html-text-mixin, and then I populate it via render-html-to-text. You can
see the code here:

https://github.com/martindemello/exolve-editor/blob/master/gui.rkt#L28

martin

On Tue, Nov 12, 2019 at 4:00 PM Andre Garzia  wrote:

> Hi Friends,
>
> Does anyone here know what is the best way to show styled text in a
> Racket GUI application?
>
> I've got some markdown that I wish to display but I can't find how to
> display any form of styled text, let alone markdown.
>
> I've started a little project to implement webviews but I think they are
> overkill for this project and to be honest, I couldn't figure out how to
> display a webview on windows.
>
> If anyone could point me into some module or direction, I'd really
> appreciate it.
>
> Best
>
> Andre
>
> --
> 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/a2d7247d-0ca7-faba-c346-3ce0cdd9f130%40andregarzia.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/CAFrFfuGB6q8R_h-8V27WpxNBEiiGRxZu_YjDP5RbZ-EK7pv_mQ%40mail.gmail.com.


Re: [racket-users] Re: raco setup equivalent for building standalone executables?

2019-11-10 Thread Martin DeMello
Thanks, that's helpful. I'll probably take the same route as you with a
build.rkt; it would be nice to have everything self-contained and not
depend on platform-specific shell scripts or another language.

martin

On Fri, Nov 8, 2019 at 7:06 PM Alex Harsanyi  wrote:

>
> There is no such raco command, as far as I know.  I see two possible
> solutions to your problem:
>
> 1)  Place the raco commands in a shell script, so that the application can
> be built by running the single shell script
>
> 2) The raco pkg, make, exe and distribute commands all provide a Racket
> level API, so you could write a racket program which builds your
> application by running "racket build.rkt"
>
> I took the second approach with my application, and the Racket program
> which builds it is here:
> https://github.com/alex-hhh/ActivityLog2/blob/master/build.rkt
>
> In my application I decided not to install required modules, but instead
> to check if the required modules are present and report a helpful error
> message if they are not installed.
>
> Hope this helps.
>
> On Thursday, November 7, 2019 at 5:37:31 PM UTC+8, Martin DeMello wrote:
>>
>> I'd like to set up a project so that I can check out its git repo, call a
>> single raco command, and have it install all the packages it needs, compile
>> executables, and finally invoke raco distribute and generate a single
>> binary. I've gone through the docs for raco setup but it seems to be geared
>> towards installing into the current machine, and I couldn't find anything
>> else that looked relevant.
>>
>> martin
>>
> --
> 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/9761567c-fca1-4256-9599-a573fd60daf0%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/9761567c-fca1-4256-9599-a573fd60daf0%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


[racket-users] getting intermediate values out of a do chain in functional-lib:data/monad

2019-10-23 Thread Martin DeMello
I have the following code, which in sequence calls the load-file dialog,
loads the file, processes it and populates a textbox:

  (define (try v e)
(if v (success v) (failure e)))

  (define (load-and-process-file textbox parse fmt)
  (define f #f)
  (let* [(text
  (do [fname <- (try (get-file) 'no-filename)]
(define _ (set! f (some-system-path->string fname)))
[contents <- (try (file->string fname) 'read-error)]
[xw <- (try (parse contents) 'parse-error)]
(try (fmt xw) 'format-error)))
 (status
  (either error-string
  (λ (t) (begin (replace-text textbox t)
"Loaded file ~a"))
  text))]
(and status (set-status (format status f)

I've resorted to set! to get the filename out of the do chain so I can
display it as part of the status, but that feels a bit hacky. Is there a
neater way to do it?

martin

-- 
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/CAFrFfuGOnLMMCMfCN4HyMhWXV9OUQvQ-54xDrt4gEV7AV2JTiw%40mail.gmail.com.


[racket-users] drracket indentation in vim

2019-10-23 Thread Martin DeMello
Is there a good way to call out to the indentation code drracket uses from
within vim? even just manually piping the whole file through an indenter
would be fine.

martin

-- 
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/CAFrFfuHUDmo%3DcejJpvECb4tuT%3D68AjwffKgDRYVQtGwQO7qu8A%40mail.gmail.com.


Re: [racket-users] horizontal alignment in a message% or equivalent

2019-10-13 Thread Martin DeMello
thanks, that worked nicely!

martin

On Sun, Oct 13, 2019 at 8:02 AM Laurent  wrote:

> If I remember correctly, I think you want to add a spacer box at the right
> of your message% in the same panel:
> https://docs.racket-lang.org/gui/grow-box-spacer-pane_.html?q=message%25
> so that the message takes only the space it needs and is thus flushed to
> the left.
>
>
> On Sun, Oct 13, 2019 at 8:11 AM Martin DeMello 
> wrote:
>
>> I'm trying to create a message% with the text left-justified rather than
>> centred, and have been searching through the docs with no luck. Is there a
>> way to do it, or a widget I should be using instead? My use case is to
>> provide a status message at the bottom of a frame.
>>
>> martin
>>
>> --
>> 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/CAFrFfuHv8WAVnSSQibmQ7DOFoJjw_HyVkXm_7Y-2He4fPQ30Hw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/racket-users/CAFrFfuHv8WAVnSSQibmQ7DOFoJjw_HyVkXm_7Y-2He4fPQ30Hw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>

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


[racket-users] horizontal alignment in a message% or equivalent

2019-10-13 Thread Martin DeMello
I'm trying to create a message% with the text left-justified rather than
centred, and have been searching through the docs with no luck. Is there a
way to do it, or a widget I should be using instead? My use case is to
provide a status message at the bottom of a frame.

martin

-- 
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/CAFrFfuHv8WAVnSSQibmQ7DOFoJjw_HyVkXm_7Y-2He4fPQ30Hw%40mail.gmail.com.


Re: [racket-users] Alternative UI toolkits

2019-08-04 Thread Martin DeMello
Not used it myself, but there's this IUP binding:
https://chust.org/repos/scheme-iup/index

martin

On Sat, Aug 3, 2019 at 4:42 AM Stephen De Gabrielle 
wrote:

> Hi
>
> Has anyone done any work on using racket with other UI toolkits?
>
> I don’t think so but I thought it was worth asking - just in case.
>
> 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/CAGHj7-LvuH3rjm1x7O-iwR33CfW3xuV0Yz2S7SX_eTu%2Bjr%2Ba3g%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/CAFrFfuHKOz8Y5miWwf89Vy4UiwcjS2mVdJ9xQXYGvz3CAxgjHg%40mail.gmail.com.


[racket-users] is anyone using the ffi with c++?

2016-06-19 Thread Martin DeMello
I've googled around a lot but couldn't find anything. I would like racket
to be the main program, and consume a C++ library so I can play with it
interactively in a repl, and write small racket programs to automate C++
object creation and method calls. Writing a glue-code main.cpp would be
fine, but I am trying to avoid manually wrapping C functions around
everything in the library.

martin

-- 
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] Programming language popularity (there's no accounting for taste!)

2016-02-24 Thread Martin DeMello
I don't know about scheme being racket; both chicken and gambit seem to
have reasonably active communities.

I was also surprised at the 16k hits for pony, which has essentially no
ecosystem yet. but actually doing the google search it seems like there's
tons of noise in there.

martin

On Wed, Feb 24, 2016 at 9:24 AM, Vincent St-Amour <
stamo...@eecs.northwestern.edu> wrote:

> If we add up the "Racket" and "Scheme" numbers (the latter being, I
> suspect, mostly Racket), the total is pretty close to Ruby. I find that
> amusing. :)
>
> Actually, I'm curious what the numbers look like if you count "PLT
> Scheme" towards Racket.
>
> Vincent
>
>
>
> On Wed, 24 Feb 2016 11:06:51 -0600,
> Brian Adkins wrote:
> >
> > I began compiling very crude statistics on programming language
> popularity back in 2009, and just kept doing it periodically. Initially I
> did it manually, but I finally got smart and wrote the following Racket
> program to scrape the results automatically:
> >
> > https://gist.github.com/lojic/83fff86aeea6af1c31ac
> >
> > The numbers should clearly be taken lightly, but there is *some*
> information to be had. Here is the latest post:
> >
> >
> http://blog.lojic.com/2016/02/24/programming-language-popularity-part-ten/
> >
> > I am fortunate in being able to choose whatever tool I feel is best, so
> popularity isn't that important to me. Having a critical mass of libraries
> is, but that's another matter.
> >
> > After a decade of C/C++, followed by a decade of Java, I came across
> Ruby, and it has been my primary development language for the last decade.
> Ruby was such an improvement over Java that it finally dawned on me to make
> a purposeful search to see if I might get an improvement over Ruby that it
> was over Java.
> >
> > Thus began a nine year search through Common Lisp, Haskell, Clojure,
> Standard ML, OCaml, Julia, Pony (barely), etc., and Racket has emerged as
> the clear winner for me personally. I'm already as productive in Racket as
> I am in Ruby for a number of things, but I do have a fair amount of work to
> do before I'm as productive in web development as I am with Rails. I'm
> hoping that 2016 will be the year of preparation to allow a complete switch.
> >
> > Brian
> >
> > --
> > 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] racket users fight for their right to colon keywords

2015-10-14 Thread Martin DeMello
Chicken scheme has an option for that:
http://wiki.call-cc.org/man/4/Non-standard%20read%20syntax#keyword

I'm a fan; it makes the code pretty pleasant to read.

martin

On Wed, Oct 14, 2015 at 9:29 AM, Jukka Tuominen <
jukka.tuomi...@finndesign.fi> wrote:

> Yoda like that would, but to me it looks backwards. How about...?
> key: value
>
> br, jukka
> UX Manager :)
>
> Sent from my iPhone
>
> > On 14.10.2015, at 18.50, Neil Van Dyke  wrote:
> >
> > We are conducting a highly scientific poll.
> >
> > The question we want to answer is whether people would like for the
> Racket standard languages to have symbols that begin with the colon
> character (except for the symbol `:`) to read the same has keywords that
> begin with pound-colon.
> >
> > That is, when this glorious colon-keywords support is added, instead of
> having to type and look at:
> >
> >(foo #:abc 1 #:xyx 42)
> >
> > you can choose to bask in the beauty of:
> >
> >(foo :abc 1 :xyx 42)
> >
> > Then you would be free to use the gorgeous colon-keywords everywhere in
> Racket, including in quick one-line examples in email list posts.
> >
> > All people of great aesthetic sense, intellect, and good moral fiber,
> who would naturally like everyone to have the right to use either
> colon-keywords or (eww) pound-colon keywords (in unity, and without
> unnecessary `#lang` schisms!), should answer the quick poll:
> >
> >http://goo.gl/forms/Kwl3uZVMsb
> >
> > (When the poll question asks "Is it worth changing?", read it is as "You
> are a good person, and you naturally think Racket should support both
> colon-keywords and pound-colon keywords, right?")
> >
> > I call upon all freedom-loving Racketeers to stand up and fight for the
> righteous cause of colon-keywords.  The moment to answer this highly
> scientific poll is now.
> >
> > Neil V.
> >
> > --
> > 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] Naming for generalization of find-min and find-max?

2015-10-12 Thread Martin DeMello
One problem with generalising find-max and find-min into a single hof is
that they are closer in spirit to a fold than a find. The name find- makes
you think that the passed in function should be a predicate on one element,
not two. How about something like first-by?

> (first-by stringstring second) '((3 pears) (1
banana) (2 apples)))
'(2 apples)

martin

On Sun, Oct 11, 2015 at 3:24 PM, Alex Knauth  wrote:

> Hi,
>
> Alexis King and I were discussing adding versions of argmin and argmax to
> the alexis/collection library, but we agreed that find-min and find-max
> were clearer names. Then we came up with a generalization of those that
> would take an ordering procedure (< for find-min and > for find-max), and
> find the element that had a property greater/less than the properties of
> all the other elements, by the ordering procedure (not restricted to
> numbers).
>
> The problem was naming it. We thought of `find-best` and
> `find-most-relevant`, but `find-best` would be confusing when it's being
> used to find the worst case, and `find-most-relevant` seems better but to
> wordy.
>
> Do any of you have any ideas?
>
> Examples:
> > (the-function < first '((3 pears) (1 banana) (2 apples))) ; find-min
> would be a shorthand for this
> '(1 banana)
> > (the-function > first '((3 pears) (1 banana) (2 apples))) ; find-max
> would be a shorthand for this
> '(3 pears)
> > (the-function stringstring second) '((3 pears) (1
> banana) (2 apples)))
> '(2 apples)
> > (the-function string>? (compose1 symbol->string second) '((3 pears) (1 
> > banana)
> (2 apples)))
> '(3 pears)
>
> *https://github.com/lexi-lambda/racket-alexis-collections/pull/9#issuecomment-145727937
> *
>
> --
> 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] reload package within drracket without restarting

2015-09-08 Thread Martin DeMello
Hi,

I'm working on the drracket-vim-tool, so I'm using a copy installed from my
local directory. Is there a better way to reflect changes than quitting and
restarting drracket?

martin

-- 
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] high memory usage of gui app

2015-09-07 Thread Martin DeMello
I have a small GUI app that is taking up a lot of memory - 135MB even when
run from a compiled executable and 235MB when run via "racket gui.rkt". Is
this expected? If not, could someone please take a quick look and see if
I'm doing something obviously wrong?

Code is here: https://github.com/martindemello/pangrid/tree/polyglot/racket

martin

-- 
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] Overriding sexp highlighting in drracket

2015-09-06 Thread Martin DeMello
Let's say I have the following:

(let ([x (foo bar)] ... )

In the regular drracket editor, when I move the cursor between the ) and ]
it highlights (foo bar). In the vim emulator, the cursor has been replaced
by a block that highlights a character, rather than a line just before it.
So the same cursor position would display a box over the ] rather than a
line between ) and ], and therefore backward-sexp needs to match the [
rather than the (.

There is the following code in the vim editor to handle explicitly hitting
%:

  ;; implements the behavior of "%" and friends in vim
  (define/private (do-matching-paren action)
(define pos-box (box 0))
(get-position pos-box)
(define pos (unbox pos-box))
(define char (get-character pos))
(match char
  [(or #\) #\] #\})
   (action 'backward (get-backward-sexp (add1 pos))
 (add1 pos))]

and I was trying to do the same for highlighting the sexp when the cursor
is over the closing ), but I can't figure it out.

martin

On Sun, Sep 6, 2015 at 5:00 PM, Robby Findler <ro...@eecs.northwestern.edu>
wrote:

> I am not quite following what you want to do. Can you give an example
> interaction?
>
> Robby
>
> On Sunday, September 6, 2015, Martin DeMello <martindeme...@gmail.com>
> wrote:
>
>> I'm trying to override the automatic backward-sexp highlighting in
>> drracket to highlight the sexp based on the ) after the cursor rather than
>> before it [https://github.com/takikawa/drracket-vim-tool/issues/13]. Is
>> this possible? I tried overriding flash-backward-sexp but it didn't seem to
>> have any effect.
>>
>> martin
>>
>> --
>> 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.