[racket-users] Help not working after fresh installation of Racket 8.3

2021-11-25 Thread Erich Rast
On Linux Mint I installed Racket 8.3 as usual in local folder /home/nemo/racket. Now when I try to access the help in the browser (recent version of Firefox), any link I click results in an error message, for example: *Could not display "/home/nemo/racket/doc/quick/-index.html" The location is

Re: [racket-users] Help not working after fresh installation of Racket 8.3

2021-11-25 Thread Erich Rast
@gmail.com wrote: > Maybe: raco setup --doc-index > > On Thu, Nov 25, 2021 at 11:28 AM Stephen De Gabrielle > wrote: > >> My first guess would be to use raco to rebuild the docs - but I can’t >> remember the exact command. It’s probably in raco pkg >> >> &

[racket] application-file-handler problem on OS X

2011-09-09 Thread Erich Rast
Hi all, I have a problem getting application-file-handler to work as I would have expected on OS X 10.7 ("Lion"). This seems to be a bug/misfeature. The problem is that when a file of the right file type is opened by double-clicking it in the Finder, the application does not receive it as a comma

Re: [racket] application-file-handler problem on OS X

2011-09-09 Thread Erich Rast
> How about a new `application-started-empty-handler' parameter for a > function that is called only when the `application-file-handler' That would be great! All I need is a means to get the standard start behavior of graphical applications on OS X. Best, Erich __

Re: [racket] Writing parallel racket benchmarks

2011-09-26 Thread Erich Rast
One question out of curiosity. In the parallel Mandelbrot benchmark on the language shootout page, languages like C, C++, Ada, Java 7 have 100% CPU utilization on all cores. Racket has 94% on all cores, whereas other languages values are sometimes much lower and differ from core to core. What infl

[racket] Application and document icons on Windows

2011-10-13 Thread Erich Rast
I have finally found the time to rewrite an old shareware application entirely in Racket. It works very well and only the Windows version still needs some polishing. For OS X and Linux I use a function that modifies a distribution created from the menu item; it opens the image/unpacks the .tgz, a

[racket] Applicaton icon on windows

2011-10-15 Thread Erich Rast
Sorry for asking twice...this is currently a showstopper issue for me. I need to set a custom icon for an application built with DrRacket. On OS X this is just a matter of adding an icon and a custom plist to the bundle, but I've learned that on windows you apparently need to use a resource hackin

Re: [racket] Applicaton icon on windows

2011-10-16 Thread Erich Rast
ying is failing, but I do > believe that Racket rewrites the binaries to tell itself where to find > its code (sometimes embedding the code right in there at some known > offset), so if something is also doing that, it maybe is messing that > process up. > > Robby > > O

[racket] Reliably disable/redirect console output

2011-10-17 Thread Erich Rast
Is it possible to reliably disable/supress or redirect the console error and the ordinary output in a GRacket application? I tried: (let ((out (open-output-string)) (err (open-output-string))) (parameterize ((current-output-port out) (current-error-port err))

Re: [racket] Reliably disable/redirect console output

2011-10-17 Thread Erich Rast
On Mon, 2011-10-17 at 14:02 -0600, Ryan Culpepper wrote: > It's possible that the output happens when the main module's requires > are executed. Actually, yes, it's just that. I guess I'm paying the price now for having been a bit picky. Many of the initialization routines in my modules delibera

[racket] Fullscreen frame and keyboard focus questions

2011-10-23 Thread Erich Rast
Hi, I've got a bit of a strange requirement. What I need: a text% with corresponding editor canvas centered on the screen filled with a background color or image. Various tools and "overlays" might show up on the background around the editor. Method 1: Make a frame% fullscreen and put vertical a

Re: [racket] arity of + versus <=

2011-10-27 Thread Erich Rast
Binary relations versus associative operations? Subjective opinion: I'm not saying it couldn't be otherwise, but to me the difference makes sense. At least (< 1) should always be an error in my opinion. Regarding (< 1 2 3 4) as a shortcut for 1 < 2 < 3 < 4, well, that's more debatable. Best, Er

[racket] Text% and editor-canvas% typewriter scrolling

2011-10-30 Thread Erich Rast
Is it possible to (halfway easily) implement "typewriter" scrolling on the basis of an editor-canvas% and text%. I've discovered scroll-with-bottom-base which already goes in the right direction. Now here is what I'm looking for: - Editing always takes place on the same line, the edit line, whose

Re: [racket] set! racket behaviour

2011-10-31 Thread Erich Rast
Doesn't really answer your question, but why not use something like this instead: (define inc (let ((counter 0)) (lambda () (set! counter (add1 counter)) counter))) Best, Erich On Mon, 2011-10-31 at 12:58 -0400, jkaczo...@aol.pl wrote: > Hi, > > I’m using DrRacket. > In an e

[racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
Is there a fast way to iterate over items or words in a text% instance starting from some position. For example, I'd like to go forward or backward starting from a position until a character in a given srfi14 char-set is found. Using a string returned get-text doesn't seem to work in general beca

Re: [racket] Text% efficiently iterating over items

2011-12-12 Thread Erich Rast
if not, then you do have to iterate snip by snip. The positions > inside string-snip%s are offsets from the position of the whole snip > for characters (is that what you're asking for when you say > text-snip%?). > > Robby > > On Mon, Dec 12, 2011 at 4:08 PM, Erich Rast

Re: [racket] Mark Tarver is the man!

2012-01-02 Thread Erich Rast
On Sun, 1 Jan 2012 15:42:23 -0800 Mark Engelberg wrote: > The PLT team clearly cares passionately about creating and maintaining > real, usable languages and tools. That is why Racket exists. Very > few academic projects produce anything nearly as useful and > professional. I can wholeheartedl

Re: [racket] Documentation enhancement suggestions

2012-01-02 Thread Erich Rast
I personally have no quirks with the existing documentation, I think it's excellent. But here is another suggestion that I would find tremendously helpful: an auto-hover live help that pops up information about function definitions plus a short explanation of what the function does directly in the

Re: [racket] Documentation enhancement suggestions

2012-01-02 Thread Erich Rast
Oops...I didn't know that. Please disregard my last mail. Thanks a lot! > FWIW, in DrRacket, you can type f1 to search for the text that's at > the current insertion point and you can right click on a word to do a > similar search. Racket Users list: http://lists.racket-

Re: [racket] AES encryption/decryption support in Racket?...

2012-04-16 Thread Erich Rast
I've been using the "crypto" library of Dimitris Vyzovitis, which is also based on openssl. It hasn't been updated for a while, but works fine with symmetric algorithms. Best, Erich On Sun, 15 Apr 2012 17:13:00 +0200 Rüdiger Asche wrote: > Hi there, > > in my Racket code, I need to crypt/

Re: [racket] Ubuntu 12.04

2012-05-07 Thread Erich Rast
I can confirm that the latest stable release of DrRacket works fine on Xubuntu 12.04, too. On Sun, 6 May 2012 15:54:24 -0500 mauricio mejia wrote: > > the program is installed but does not load in Ubuntu 12.04 > Racket Users list:

Re: [racket] Cross-Platform Secure RNG?

2012-07-12 Thread Erich Rast
I might be wrong but MRG32k3a doesn't seem to have been cryptanalyzed extensively enough to count as cryptographically secure. Probably it isn't. The crypto library on Planet has random-bytes and random-bytes! that ought to be more secure. (However, I do not know the code OpenSSL uses to gather en

Re: [racket] racket 5.4 syntax tweak wishlist

2012-09-10 Thread Erich Rast
> > * Colon keywords -- Make symbols beginning with the colon character > > read as keywords. > > +1, but I suspect that some people really prefer the #: because it > makes the fact that it's only syntax apparent? Count me among them. The #: is more consistent and typing one more character doesn

[racket] How to wait for tcp-accpt-evt unless the listener is or has been closed?

2012-09-13 Thread Erich Rast
Hi all, I have a question about tcp-listener. I've implemented a simple filetransfer protocol whose main listener loop is this: (define (start-listen local-port save-path from-ip progress-proc final-proc [timeout 60.0] [file-table (make-hash)]) (define listener (tcp-listen

Re: [racket] How to wait for tcp-accpt-evt unless the listener is or has been closed?

2012-09-13 Thread Erich Rast
> > A simpler possibility is to use a custodian I've tried a custodian and it worked fine. But then I've figured out that a simple exception handler also works, and in this case it has the advantage that the finalize-proc called at the end of my file transfer will terminate gracefully. (def

[racket] Scribble Planet problem

2012-10-02 Thread Erich Rast
Hi, I've developed a small library that I would like to put on Planet, but when I create the planet package and test-install it using raco planet fileinject, my scribble documentation messes up the Racket docs. My docs are listed in the documentation main page and can be viewed, but just before th

Re: [racket] Scribble Planet problem

2012-10-02 Thread Erich Rast
Thanks Danny! The import statement shows up correctly now, but I still get a corrupted search function in the Racket documentation when the package is installed. I've overlooked an error during package installation earlier, here it is: make-script: unexpected value rendered: '((font ((class "badl

Re: [racket] Scribble Planet problem

2012-10-02 Thread Erich Rast
> Odd! Hmmm... Are your sources anywhere where we can check it out to > try it ourselves? I've uploaded them temporarily to launchpad: https://code.launchpad.net/~erich-snafu/+junk/fileutils Thanks a lot for your help. Best, Erich Racket Users list: http://lists.ra

Re: [racket] Scribble Planet problem

2012-10-03 Thread Erich Rast
Seems I have a certain talent of stumbling over Heisenbugs. :) I've applied your patches and will finalize the package soon. Thanks a lot, Danny! Best, Erich On Tue, 2 Oct 2012 15:38:10 -0600 Danny Yoo wrote: > Error traced. No scribble document should break the search index, but > for some

[racket] Web server and file upload/download examples

2012-10-08 Thread Erich Rast
Hi, I'm not very experienced with using the web server yet and am looking for advice and examples of how to download and upload files. I'm particularly interested in any example of uploading a file using a racket client (not a browser) to the web server, because it seems hard to understand this fr

[racket] Scribble - how to document init-fields of a mixin with or without default values

2012-10-18 Thread Erich Rast
Hi, I have a mixin with several init-fields, but it seems that scribble won't allow me to use @defconstructor/auto-super (Error defmixin: use does not match pattern) For example, in the following skeleton of a mixin, (define tooltip-mixin (mixin (window<%>) () (super-new) (init-field t

[racket-users] Generating preorders

2015-09-22 Thread Erich Rast
Hi, First of all, this is not a homework assignment. For some work in philosophy (modern philosophy, I guess) I need to generate all preorders from a given list up to a reasonable size of n=8. I didn't find any general algorithm for it, so I made up my own that unfortunately doesn't work correctly

Re: [racket-users] Generating preorders

2015-09-23 Thread Erich Rast
Thanks Robby and Vincent for the advice. Yes, I should have been more precise, I need to generate all *total preorders* of a given size. The task is equivalent to generating all weak orders. I think my idea to do this on the basis of permutations is flawed and I'll start from scratch but it would

Re: [racket-users] Generating preorders

2015-09-23 Thread Erich Rast
You've just saved my day! Thanks a lot! Best, Erich On Wed, 23 Sep 2015 10:38:07 -0400 Josh Grams wrote: > On 2015-09-23 09:46AM, Erich Rast wrote: > >Someone on stackoverflow gave me a working implementation in Python 3 > > > >https://stackoverflow.com/questions/32

[racket-users] Reliable equality testing of procedures

2015-11-04 Thread Erich Rast
Hi, I have a number of functions for computing raw distance measures and functions to compute their maxima for a given number of items, so to normalize them to [0,1] I provide this: (define (normalize/distance measure maximum) (lambda (p q) (/ (measure p q) (maximum (full-domain-size p q)))

Re: [racket-users] Re: Reliable equality testing of procedures

2015-11-05 Thread Erich Rast
> (struct measure (measuring-proc maximum-proc) > #:prop prop:procedure (struct-field-index measuring-proc)) > > (define footrule (measure footrule-proc footrule-maximum)) > Thanks a lot! I didn't know about this option. That seems like a good way of embedding the information into the measure

Re: [racket] Checking infinite loops

2010-10-04 Thread Erich Rast
Perhaps the original poster was just asking for how to check for the occurrence of a loop in a graph, presumably in the context of traversing it. At least that's how I understood his mail when I first read it -- now I'm no longer so sure. Best, Erich On Sun, 2010-10-03 at 23:48 -0400, Stephen

[racket] [REQ] multi-column-list-box% planned?

2011-01-24 Thread Erich Rast
Dear all, This is my annual reminder/question whether a multi-column-list-box% with a native look-and-feel is planned anytime soon for racket? Now that the graphical foundations have been mostly rewritten this would make a good candidate for a new feature in a future update. Best, Erich __

[racket] [Off Topic] Theoretical questions

2011-03-16 Thread Erich Rast
e infamous "accelerated Turing machine" it is not immediately obvious to me why this should be so. I'd be glad about answers or good and halfway accessible literature that deals with these questions. (Perhaps it's better to reply off the list.) Best, Erich --

Re: [racket] drracket editor running too slow

2011-03-28 Thread Erich Rast
Just for the record, I've been using a one-week old version nightly built of 5.1 on Ubuntu 10.04 daily during last week and didn't experience any slowdowns. (on a reasonably fast 2.6 GHz i7 920 with 6GB RAM, though) So the slowdown must be specific to Ubuntu 10.10 or your configuration. Best, Er

[racket] Automatically include external dynamic libraries into distribution

2011-03-28 Thread Erich Rast
Hi all, Is there a way to automatically include all dynamic libraries used into a distribution? -- i.e. some option to create a distribution that is guaranteed to be self-contained? I know that this conflicts with the idea of having dynamic libraries in the first place but sometimes it is needed.

Re: [racket] Racket on Centos 5

2011-03-29 Thread Erich Rast
Hi! You could use this cool utility: http://stanford.edu/~pgbovine/cde.html to create a binary distribution on a similar system where DrRacket works, and then use it on Centos. Just an idea...haven't tested it. Best, Erich > drracket tries to start, but the pango stuff seems to be really ne

Re: [racket] Suggestion for saving preferences

2011-04-05 Thread Erich Rast
It depends a bit on what your program is used for and how long it is supposed to remain in use. If you intend to use it for a long time (> 10 years) or might later need to read prefs with a program written in another language, consider using XML. You need two procedures for each struct, struct->st

[racket] text-field% receiving characters it shouldn't receive

2011-05-04 Thread Erich Rast
Hi, I've got a problem with a GUI app in which a text-field% is on top of a frame% and a list-box% below it. 1.) When the text-field has the keyboard focus, it receives characters of menu shortcuts, e.g. if I press ctl-n for new document, the menu callback is executed correctly but the text-fiel

[racket] Two more focus questions

2011-05-04 Thread Erich Rast
Two more questions related to keyboard focus: 1.) Is it possible to change the default "gadget order" in a frame%? Right now, the first created gets the first focus. I have a text-field and a popup menu above a list-box, but would like to have the list-box get the default keyboard focus (i.e. when

Re: [racket] Two more focus questions

2011-05-04 Thread Erich Rast
> If I remember correctly, you're usually on a Mac? The `show' method on > frame% should move the focus, too. I'm using Ubuntu as a primary development platform by now but intend to deplay the app for all platforms. > Below is the program I tired, where clicking "Switch" switches the > front fra

[racket] OS threads, parallel-map, etc.

2011-05-31 Thread Erich Rast
Recently I started to wonder why Racket has futures and now also places but so far lacks traditional OS-level threads and parallel-map, parallel-for-each, parallel-sort, parallel-filter, for/parallel and the likes for sequences. It seems to me that such sequence functions could even choose their o

[racket] Bloom filter?

2011-06-06 Thread Erich Rast
Hi, I need to check whether a given string already occurs in a list of several million strings, where occasional false positives are acceptable. Before reinventing the wheel, has anybody already implemented a space-efficient Bloom filter in racket and would like to share it? Or, what else would

Re: [racket] Bloom filter?

2011-06-06 Thread Erich Rast
ammingpraxis.com/2009/04/21/probabilistic-spell-checking/. > > On Mon, Jun 6, 2011 at 9:48 AM, Erich Rast wrote: > Hi, > > I need to check whether a given string already occurs in a > list of > several million strings,

Re: [racket] Distribution strategy

2011-07-13 Thread Erich Rast
Perhaps I don't really understand the question. R6RS is a standard, so insofar as an implementation is standards-compliant the source distribution should not need to be modified for different implementations. In praxis, however, there might be problems due to lack of complete standards compliance.

[racket-users] Editor-canvas% and transparent style = black?

2017-11-07 Thread Erich Rast
Hi! This is something I've been wondering for a while already but never had time to ask. When an editor-canvas% is set to transparent in its style list, and I type in it, then the whole editor gets black and nothing can be seen. Shouldn't it be gray, as the window background so it looks as if yo

Re: [racket-users] Editor-canvas% and transparent style = black?

2017-11-07 Thread Erich Rast
d frame show #t) On Tue, 07 Nov 2017 17:44:07 + Stephen De Gabrielle wrote: > If you pop you code on pasterack or a gist I’ll test on OS X and > windows > > S. > > On Tue, 7 Nov 2017 at 15:49, Erich Rast wrote: > > > Hi! > > > > This is something I&#

Re: [racket-users] Editor-canvas% and transparent style = black?

2017-11-07 Thread Erich Rast
Here is how it looks on my machine: https://vimeo.com/241738557 On Tue, 7 Nov 2017 17:57:27 + Erich Rast wrote: > I thought this was a known bug that just never gets fixed. This has > given a black canvas when you click into the editor on my machine for > ages: > > #

[racket-users] Adding custom payload data to text%

2018-01-05 Thread Erich Rast
Hi all, Is there a way to associate custom payload data to individual characters and image snips in a text% instance? Maybe some package or framework class that already exists? I'd like to add custom data that is independent of styles but behaves like them. Basically, I need to keep track of arbi

Re: [racket-users] Adding custom payload data to text%

2018-01-05 Thread Erich Rast
te: > The arrows, docs information, etc that Check Syntax draws use a > data/interval-map to manage that kind of information on the side. > > https://docs.racket-lang.org/data/interval-map.html > > hth, > Robby > > On Fri, Jan 5, 2018 at 8:58 AM, Erich Rast wrote: >

[racket-users] Find out whether the debugger is running

2018-08-07 Thread Erich Rast
Hi! Is there a reliable way to find out whether a racket program is currently running in the debugger? I've got a deployment function that fails with a cryptic error message when the language is set to debugging in DrRacket and would like to print a warning in that case. Deployment ought be with

[racket-users] Notifier/subscriber pattern, preventing event cycles: What's the best practice?

2018-08-08 Thread Erich Rast
I'm implementing a global blackboard for posting events and subscribing to them and I'm wondering about the best method to prevent cycles. Since this is e.g. for 'model-change and 'view-change events, I cannot generally guarantee that clients (subscribers or notifiers) have a "direct program flow"

Re: [racket-users] Notifier/subscriber pattern, preventing event cycles: What's the best practice?

2018-08-09 Thread Erich Rast
On Wed, 8 Aug 2018 19:36:10 -0400 David Vanderson wrote: > > Is there a better solution to this problem? How do mature > > notifier/subscriber frameworks deal with these kind of problems? > > > The most straightforward solution I've seen puts the responsibility > on the view.  When the view get

[racket-users] Where to put scribblings in 'multi package?

2018-08-29 Thread Erich Rast
scrbl And "info.rkt" looks like this: #lang info (define version "0.1") (define pkg-desc "a framework for cross-platform end-user applications and their deployment") (define collection 'multi) (define distribution-preference 'source) (define pkg-authors &#

Re: [racket-users] Where to put scribblings in 'multi package?

2018-08-29 Thread Erich Rast
Thanks a lot Philip and Ryan! Splitting up the info.rkt file worked fine. The reason why I want this to be a multi-collection package is that the framework without anything gui-related is fairly small and should be required by default as (require appy). The GUI-related extensions on the other hand

Re: [racket-users] Where to put scribblings in 'multi package?

2018-08-29 Thread Erich Rast
On Wed, 29 Aug 2018 06:46:49 -0500 Philip McGrath wrote: > You don't need a multi-collection package to do this. If your > structure is: > > appy/ > | > |--info.rkt > |--main.rkt > |--gui.rkt > |--… > > Then `(require appy)` will import "main.rkt" and `(require appy/gui)` > will import "gui.rk

[racket-users] Scribble how to fix red underline keywords?

2018-09-04 Thread Erich Rast
Hi! I'm new to scribble and try to fix keywords that are underlined in red. My package is called appy and appy/gui. These export all classes and other bindings of the package. In the scribble document I tried both: @(require (for-label racket) (for-label "../gui.rkt")) and @(require

Re: [racket-users] Scribble how to fix red underline keywords?

2018-09-04 Thread Erich Rast
Nevermind, I've got it working. I used the wrong for-label require after defmodule - with a relative path instead of an absolute path, as the manual says. It works fine now. Best, Erich On Tue, 4 Sep 2018 14:28:20 +0100 Erich Rast wrote: > Hi! I'm new to scribble and try to fix

[racket-users] Scribble warnings in package documentation

2018-09-26 Thread Erich Rast
I have a long package documentation and get lots of warnings - see below. Other than that, the docs work fine, should/can I ignore them? What do they mean anyway? Best, Erich WARNING: collected information for key multiple times: '(exporting-libraries #f); values: '(appy/gui) '(appy) WARNING:

[racket-users] Problem with threads and GUI event handling

2016-08-31 Thread Erich Rast
Hi! I have a problem with the interplay between the racket GUI main thread and other threads. My application connects to a socket and creates a GUI. Some of the GUI events are sent over the socket, and everything is highly asynchronous -- there are multiple threads and channels between them for so

Re: [racket-users] Problem with threads and GUI event handling

2016-08-31 Thread Erich Rast
ents > while waiting. > > Matthew > > At Wed, 31 Aug 2016 18:10:17 +0100, Erich Rast wrote: > > > Basically, I need to wait until the connection thread ends, before > > the application should quit, but at the same time the waiting may > > not block any processing o

[racket-users] Do I need a critical section here ... and if so, how to?

2016-09-01 Thread Erich Rast
This question is also about style. Take an admittedly ugly counter like this ;; increasing counter for handles (define handle-counter 1) (define (new-handle) (begin0 handle-counter (set! handle-counter (add1 handle-counter Various threads may call (new-handle) concurrently, so I ne

Re: [racket-users] Do I need a critical section here ... and if so, how to?

2016-09-01 Thread Erich Rast
? > ;--- > > Gustavo > > > > On Thu, Sep 1, 2016 at 6:44 AM, Erich Rast wrote: > > This question is also about style. Take an admittedly ugly > > counter like this > > > > ;; increasing counter for handles > > (define handle-counter 1) &g

[racket-users] List-box% using percentages to resize multiple columns

2016-09-08 Thread Erich Rast
I'm trying to get a list-box% subclass to work with min-widths and percentage values, but I'm unable to figure out the correct total width to calculate the actual widths. Inside the listbox, I store the percentages in percentages and the minimum-widths in minimum-widths: (define/override (on-size

Re: [racket-users] Re: List-box% using percentages to resize multiple columns

2016-09-09 Thread Erich Rast
You are right. I've checked it and it was a simple case of arguments switched - 120 pixel min-width was inadvertently switched for 20%. It works fine now, and on-size seems to be the right place for calculation, too. Thanks! Best, Erich On Thu, 8 Sep 2016 17:56:38 -0700 (PDT) Alex Harsanyi w

[racket-users] Target is not an object, target #f for get-client-size

2016-09-15 Thread Erich Rast
I have a subclass of list-box% which overrides on-size and calculates relative column sizes based on get-client-size and some values provided by an init variable. However, if I don't check for "this" being an object, I get: send: target is not an object target: #f method name: get-client-size

[racket-users] Bug that causes crash ... how to debug? (Linux, Racket 6.7 but also earlier versions)

2016-10-27 Thread Erich Rast
Hi! I have a bug that in the Linux version of a mid-sized program (closed source) that causes the program to immediately crash and also causes DrRacket to immediately crash once the command key is pressed in some editor in a tab panel of an open frame. No console output, hard crashes to desktop. T

[racket-users] Macro question

2017-01-12 Thread Erich Rast
Hi all, I'm programming in Racket for many years and still haven't used macros or delved into how they work. Kind of embarrassing... anyway, it should be clear what I want to achieve in the code below. I like to wrap a module around framework/preferences, abstracting from the preference implementa

Re: [racket-users] Macro question

2017-01-12 Thread Erich Rast
Thanks for your your help. Unfortunately, I haven't managed to get my head around the phases and the question of when symbols are quoted or evaluated. I tried Matthew Buttericks change but it yields an error: "format-id: undefined; cannot reference an identifier before its definition phase: 1"

Re: [racket-users] Macro question

2017-01-12 Thread Erich Rast
Nevermind, I got it working (or at least it seems to work): (define-syntax-rule (defpref ident default test?) (begin (define ident (case-lambda [() (pref 'ident)] [(value) (pref 'ident value)])) (pref 'ident default test?))) Best, Erich -- You received this mess

[racket-users] Editor-canvas% how to set default style and use set-line-count correctly?

2017-01-26 Thread Erich Rast
Hi, I have an editor-canvas% subclass and want to set the default style, but adding it with name "Standard" to the-style-list doesn't work. Do I have to replace the style list of the canvas with a new one? Or does the default style of an editor-canvas% have to be called differently? "Basic"? With

[racket-users] Best way to ensure threads finish in GUI application?

2017-01-31 Thread Erich Rast
Hi, I was wondering what's the best way to ensure that threads end when a gui application is shut down, which synchronization mechanism I should use and which kind of program terminations would be handled gracefully by this. I'm planning on delaying certain sqlite transactions in threads, since

Re: [racket-users] Best way to ensure threads finish in GUI application?

2017-01-31 Thread Erich Rast
ue, 31 Jan 2017 13:23:03 +, Erich Rast wrote: > > Hi, > > > > I was wondering what's the best way to ensure that threads end > > when a gui application is shut down, which synchronization > > mechanism I should use and which kind of program terminations would >

[racket-users] How to determine that an image file is valid and working in image-snip%

2017-01-31 Thread Erich Rast
Hi! Is there a correct/"best practice" cross-platform way to determine whether a given pathname obtained from on-drop-file of an editor-canvas% leads to a valid image file that can be displayed by an image-snip% in a text%? Is there an official function that checks an image file? (It may load the

[racket-users] How to implement a dynamic plugin system?

2017-02-07 Thread Erich Rast
Hi all! I'm thinking about implementing a dynamic plugin system for a large application. Each plugin should have the full racket/gui language and a number of pre-defined imports from modules of the main application available. Plugins should reside in a relative directory and loadable on demand at

Re: [racket-users] How to implement a dynamic plugin system?

2017-02-07 Thread Erich Rast
Thanks for the advice. So I should use dynamic-require, but how? When I tried to use it like "require" it didn't have the desired effect - nothing was imported. I have to admit I'm struggling a bit with all the different ways of load/eval/require/enter code that I've found in the docs so far. Here

Re: [racket-users] How to implement a dynamic plugin system?

2017-02-08 Thread Erich Rast
at 2:36 PM, Matthias Felleisen > wrote: > > > > > Erich, your needs sound very much like those of DrRacket’s. > > You may wish to study how DrRacket loads tools (as in take > > a look at the source) — Matthias > > > > > > > > > > > > &

[racket-users] How to attach all modules required by the current module to a namespace and then namespace-require them

2017-02-09 Thread Erich Rast
Out of general curiosity I'm still trying to figure out how a dynamic plugin system would work. So now I'd like to namespace-attach-module for all modules that the current module imports (and their submodules), and then namespace-require them. The problem is that I don't know how to attach modules

Re: [racket-users] How to attach all modules required by the current module to a namespace and then namespace-require them

2017-02-09 Thread Erich Rast
o get a reference to the enclosing module, and use > `module-path-index-join` on that value and "../core/internat.rkt" > to get a reference to the "../core/internat.rkt" module. > > At Thu, 9 Feb 2017 12:25:35 +, Erich Rast wrote: > > Out of general curiosity I&

[racket-users] Resize panels inside panels

2017-02-23 Thread Erich Rast
I have an editor-canvas A subclasses inside a vertical-panel subclass B and below A there is another vertical-panel subclass C in B. C is shown or hidden by removing and adding it via change-children in B. However, even though A has stretchable-height set to #t, it does not resize to fill the who

Re: [racket-users] Resize panels inside panels

2017-02-23 Thread Erich Rast
Your example works and made me realize that I've accidentally removed a list-box *inside* the panel rather than the panel itself in my application. No wonder it didn't work! Thank you so much! Best, Erich On Thu, 23 Feb 2017 05:17:23 -0700 Matthew Flatt wrote: > If so, is there a change that

[racket-users] Adding right-click functionality in a list-box%

2017-02-23 Thread Erich Rast
While I'm working on GUI issues another question came up. Is there a way to add right-click functionality to a list-box? I'd like the selection to jump to the respective row on a right-click (btw, right-clicking does change the selection when the list-box gets focus but not afterwards), and *then*

[racket-users] Making a snip% select itself in a text%

2017-03-02 Thread Erich Rast
Hi! I have a simple non-editable and non-resizable snip% class that in its draw function distinguishes whether it's selected or not. It works fine when I select it in a text% with the mouse. Now I want to select it in the text% when the user left-clicks on it, so I've overridden on-event and tried

Re: [racket-users] Re: Making a snip% select itself in a text%

2017-03-02 Thread Erich Rast
On Thu, 2 Mar 2017 03:32:08 -0800 (PST) Alex Harsanyi wrote: > You need to tell the snip admin that the snip needs to be redrawn. > In your select-this-snip method, add > > (send (get-admin) needs-update this 0 0 width height) > It still doesn't work. I'm using this: (define/public (sele

Re: [racket-users] Making a snip% select itself in a text%

2017-03-02 Thread Erich Rast
I found an easy solution that does what I want it do to. It's only suitable for non-editable snips, of course. Instead of checking whether draw-caret is a pair in draw, I simply use (not (equal? draw-caret 'no-caret)) That does the job. As for keyboard events, I think I'll handle them in the sn

[racket-users] A new OOP programming construct? [slightly long post]

2017-03-30 Thread Erich Rast
Dear all, This is something I've been wondering for a long time and at the same time it's a suggestion for implementation, since I'm not familiar enough with higher Racket macrology. Often when I define a class it contains instances of other classes. To access them as a user of an instance of the

[racket-users] Convert mouse coordinates in mouse-event% to window coordinates? And also for snip%...

2017-05-23 Thread Erich Rast
Hi, For me personally, coordinates are probably the most unintuitive aspect of Racket's GUI management. The problem comes up again and again, and I never get it right, so maybe someone can clarify this once and for all. I have a mouse-event% in on-event of a snip% and would like to display a floa

[racket-users] Html to text, how to obtain a rough preview

2017-05-30 Thread Erich Rast
Hi all, I need a function to provide a rough textual preview (without formatting except newlines) of the content of a web page. So far I'm using this: (require net/url html-parsing sxml) (provide fetch fetch-string-content) (define (fetch url) (call/input-url url

Re: [racket-users] Html to text, how to obtain a rough preview

2017-05-30 Thread Erich Rast
On Tue, 30 May 2017 11:30:00 -0400 Neil Van Dyke wrote: > Writing a procedure that does what you want should be pretty easy, > and then you can fine-tune it to your particular application. Recall > that SXML is mostly old-school Lisp lists. The procedure is mostly > just a straightforward recurs

Re: [racket-users] Html to text, how to obtain a rough preview

2017-06-01 Thread Erich Rast
pict:show-pict img Best, Erich On Wed, 31 May 2017 01:34:26 -0400 Neil Van Dyke wrote: > Erich Rast wrote on 05/30/2017 04:37 PM: > > I've found out that it's far less trivial than expected, but not > > because of sxml or the tree walking itself. Often call/input-url

[racket-users] Merging all snips in text% that can be merged

2017-06-15 Thread Erich Rast
Hi! Question: Is there some method to automatically merge all snips that can be merged? I haven't found it in the docs. If there is none, I'll do it with merge-with in snip% or in my xexpr directly that I'm using on top of text% as an exchange format. I was just wondering if I'm missing something

[racket-users] Question about text% undo and on-change

2017-07-04 Thread Erich Rast
I have to integrate the undo/redo functionality of text% into a custom undo/redo system, because in my application nearly everything is undoable. Basically I need a reliable way to intercept and track the text%'s undo additions, so I can add an undoer to my undo system whenever text% adds an inter

[racket-users] Putting everything in a single monolithic source file

2017-07-21 Thread Erich Rast
I'm using mostly racket-mode in emacs for development and even with helm and projectile mode greping info from the source directory is cumbersome. So I was thinking about putting my entire project into one source file with lots of explicit (module ...) declarations. This doesn't break modularity, I

Re: [racket-users] Printing Quickly

2017-07-25 Thread Erich Rast
This is difficult, since text% and everything on top of it is unfortunately rather slow and complex. My best advice is to limit or structure the amount of information displayed by the program, since the end user (including you) is likely even slower in parsing the information than racket is display

[racket-users] Can this be optimized?

2017-09-26 Thread Erich Rast
According to profiling, the following sxml-handling function (consolidate sxp) is a major bottleneck in my application. It reduces all subsequent sxml text elements with the same attributes to one and is part of exporting from text% to xml. I'm not used to optimizing Racket code. Does somebody ha

  1   2   >