Re: [racket-users] How to check for existing definitions

2015-05-31 Thread Alexander D. Knauth
On May 24, 2015, at 3:20 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I can of course use /version/ to check for Racket's version but this doesn't take patches or third party libraries/modules into account. I was just re-reading this, and for your particular use case this has

Re: [racket-users] How to check for existing definitions

2015-05-27 Thread Michael Tiedtke
Thank you very much! That was exactly what I needed. (define (reset-flowers flowers) [when (method-in-interface? 'snap-back-after-regions? card%) ;; See Animations in the README file and see also ;; mred/15064 in Racket's bug database. This is ;; conditional for

Re: [racket-users] How to check for existing definitions

2015-05-27 Thread Alexander D. Knauth
On May 27, 2015, at 6:13 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I'm a little bit astonished that Racket doesn't offer a defined? primitve when it's not possible to implement it with macros because of the strange compile-time behavior. Here’s a fairly useless macro that

Re: [racket-users] How to check for existing definitions

2015-05-27 Thread Laurent
Just as a side comment, the more usual OO way (less 'hacky') to do that kind of things is to define a specific interface that contains a set of method declarations, and make the class implement this interface (or none actually, in which case the interface is used only as a tag). Then you can test

Re: [racket-users] How to check for existing definitions

2015-05-27 Thread Michael Tiedtke
Il giorno 27/mag/2015, alle ore 13.08, Alexander D. Knauth ha scritto: On May 27, 2015, at 6:13 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I'm a little bit astonished that Racket doesn't offer a defined? primitve when it's not possible to implement it with macros because of

[racket-users] How to check for existing definitions

2015-05-24 Thread Michael Tiedtke
I'm used to check for the presence of a definition of a given symbol with (defined? symbol) Probably I still remember that from GNU Guile Scheme but I was not able to find an equivalent in Racket. I need something like that to check during runtime or at least at start-up for the existence of a

Re: [racket-users] How to check for existing definitions

2015-05-24 Thread Laurent
This may be of interest to you: http://stackoverflow.com/questions/20076868/how-to-know-whether-a-racket-variable-is-defined-or-not For methods, you can use this instead: