[racket-users] (make-syntax-delta-introducer a b) and (m-s-d-i b a) have scopes in common

2016-07-31 Thread Dupéron Georges
In the following code, (make-syntax-delta-introducer a b) and (make-syntax-delta-introducer b a) have scopes in common (#(8979 module) and #(8980 module m 0)), which are part of both inputs. The docs do not mention that some scopes present in both `a` and `b` can be part of the resulting introd

[racket-users] Re: get the contract of a (or any) function - or find matching functions

2016-07-31 Thread Dupéron Georges
Le samedi 16 juillet 2016 09:20:33 UTC+2, mattap...@gmail.com a écrit : > I wonder if there's a way to get the contract of functions in the libraries? > > PS. I'm trying to find target functions in the namespace that'll 'match' the > values I have (i.e. that can 'work with' the values I have). An

[racket-users] Macro expanding to #'(begin) lacks arrows in DrRacket

2016-08-03 Thread Dupéron Georges
I have two files, `a.rkt` and `b.rkt`: ;; a.rkt #lang racket (provide foo) (define-syntax (foo stx) ;; Do some compile-time side effects here… #'(begin)) ;; b.rkt #lang racket (require "a.rkt") (foo) The `foo` macro defined in `a.rkt` does some side effects, and expands to `(begin)`. When `

[racket-users] Re: Problems with modules and with raco

2016-08-13 Thread Dupéron Georges
Le vendredi 12 août 2016 14:53:35 UTC+2, rumpz a écrit : > It's like it marked down somewhere that those structs refer to the definition > of "word" in webapp/words.rkt, and not the one in webapp2/words.rkt This sounds to me like it is using the old bytecode files, since the original files haven

[racket-users] Re: linespacing in scribble with superscripts

2016-08-23 Thread Dupéron Georges
Le jeudi 18 août 2016 22:21:37 UTC+2, jos.koot a écrit : > #lang scribble/manual > bla blah blah@(linebreak) > blah blah bla @superscript{blah blah bah}@(linebreak) > bla blah blah > > the linespacing between the first 2 lines is larger > than between the last 2 lines. I suppose you are talking a

[racket-users] [ANN] A type-expander library for Typed/Racket

2016-08-24 Thread Dupéron Georges
Based on Asumu's work on type expanders (https://github.com/racket/racket/compare/master...takikawa:tr-type-expander), I have written a library which adds support for type expanders in typed/racket. Type expanders are to types what match expanders are to match patterns. A type expander is a spe

[racket-users] Re: DrRacket's auto-indentation outside DrRacket?

2016-08-25 Thread Dupéron Georges
I'll add a few relevant and less relevant references: This discussion [1] is about extending drracket's built-in indenter, using `drracket:indentation` [2]. The #lang's get-info function should accept that symbol as a key, and return an indentation function. To access the default indentation by

Re: [racket-users] Re: DrRacket's auto-indentation outside DrRacket?

2016-08-25 Thread Dupéron Georges
Le jeudi 25 août 2016 23:47:21 UTC+2, Matthias Felleisen a écrit : > If Travis re-indented my benchmarks/samples every time I commit one, I would > be rather unhappy. I think that's what David meant by "A way to represent indentation specifications for new syntactic forms": the idea would be to

Re: [racket-users] Re: DrRacket's auto-indentation outside DrRacket?

2016-08-25 Thread Dupéron Georges
Le vendredi 26 août 2016 00:02:13 UTC+2, Matthias Felleisen a écrit : > The specification has to come with feature and/or the language, not the tool. > How would Emacs know about it? Or Notepad? Every editor — and every tool in > the tool chain — must know what indentation means if it may touch i

[racket-users] How would a library express indentation rules? [was: DrRacket's auto-indentation outside DrRacket?]

2016-08-25 Thread Dupéron Georges
I'm starting a new discussion topic, so as not to crowd https://groups.google.com/forum/#!topic/racket-users/4SnwpX6gYqk . 2016-08-26 0:32 GMT+02:00 Alex Knauth : > How would a library express indentation rules? Would indentation rules meant for s-expression languages be useful in at-exp or sweet-

Re: [racket-users] [ANN] A type-expander library for Typed/Racket

2016-08-27 Thread Dupéron Georges
Le samedi 27 août 2016 03:54:00 UTC+2, Anthony Carrico a écrit : > On 08/26/2016 11:10 AM, Matthias Felleisen wrote: > Likewise. Can you say something for us lurkers about the use cases? Do > you think it is workable to have an identifier act as a type expander, > match expander, normal macro and i

[racket-users] Re: How to adjust an expansion-time parameter in a dynamic-require?

2016-09-02 Thread Dupéron Georges
Le vendredi 2 septembre 2016 12:32:52 UTC+2, Jack Firth a écrit : > However, (parameterize ([param tool-func]) (dynamic-require mod-path)) > doesn't seem to work because the parameter is being set for the runtime phase > rather than the expansion time phase. Here's a solution, which also allows

[racket-users] Re: DrRacket says #%module-begin not a module

2016-09-03 Thread Dupéron Georges
Le dimanche 4 septembre 2016 01:44:01 UTC+2, David K. Storrs a écrit : > Welcome to DrRacket, version 6.6 [3m]. > Language: R5RS [custom]; memory limit: 128 MB. It seems that DrRacket is configured to use the R5RS language. Using the bottom-left menu (or Ctrl+L), select "The Racket language Use #

[racket-users] Order of reduction rules in Redex

2016-09-06 Thread Dupéron Georges
Hi all! I'm trying out redex, and I defined a simple language with (define v e) statements. I also defined an extended language, which allows expressions to be (lifted v' e'). A (lifted v' e') expression is replaced by v', and a definition (define v' e') is lifted to the top-level, just before

Re: [racket-users] Order of reduction rules in Redex

2016-09-06 Thread Dupéron Georges
Le mardi 6 septembre 2016 20:39:37 UTC+2, Sam Caldwell a écrit : > I'm not sure what it is you want. Do you want the reduction relation to be > deterministic? If so then you need to decide which order is the "right" one. > > You can do this by adding a "lifted-less expression" to your grammar Th

[racket-users] equal? and recursive data structures

2016-09-13 Thread Dupéron Georges
I'm writing a prop:equal+hash for a recursive data structure, and I noticed that it takes several comparisons of pairs of values which are eq? before equal? realises that there is a cycle, and stops. Below is the code for the trivial case, where the implementation of equality just calls itself

Re: [racket-users] equal? and recursive data structures

2016-09-13 Thread Dupéron Georges
Le mardi 13 septembre 2016 16:30:39 UTC+2, Robby Findler a écrit : > http://www.cs.indiana.edu/~dyb/pubs/equal.pdf Thanks a lot for the reference, I was looking for that. If I understand well, equal? first tries a fast algorithm which does not take cycles into account, and after a certain level

[racket-users] Re: udelim package -- more parens than you can shake a stick at

2016-09-24 Thread Dupéron Georges
Le samedi 24 septembre 2016 18:46:07 UTC+2, William G Hatch a écrit : > Udelim is a library for adding extra parens and string delimiters to > your language. I can't tell how ecstatic I am about this :) . I have been wanting to add new parenthesis shapes for a while, but never found the time to l

Re: [racket-users] udelim package -- more parens than you can shake a stick at

2016-09-25 Thread Dupéron Georges
If I understand you well, the intended use of your nested delimiters can be more or less described as syntactic sugar for #reader, with auto-detection of where the string ends: (filter foo? (python-ish-list-comprehend «thing for x in sqlish(«select * from foo») where some_pred

[racket-users] Scribble: how to use #:tag-prefix and have @elemref work within the Table Of Contents?

2016-09-30 Thread Dupéron Georges
I have two simple scribble files. The first one simply includes the second: #lang scribble/manual @title{test-tag-prefix} @include-section{sub.scrbl} And the second one uses #:tag-prefix, and inserts an @elemref in the TOC: #lang scribble/manual @title[#:tag-prefix '(lib "test-tag-prefix/s

[racket-users] Re: Scribble: how to use #:tag-prefix and have @elemref work within the Table Of Contents?

2016-09-30 Thread Dupéron Georges
Le vendredi 30 septembre 2016 14:30:05 UTC+2, Dupéron Georges a écrit : > Is there a better way to automatically generate this tag? > I can store the document tags within a global variable and cons them > everywhere I'm inserting an @elemref in the Table Of Contents, but it > seem

Re: [racket-users] Scribble: how to use #:tag-prefix and have @elemref work within the Table Of Contents?

2016-10-02 Thread Dupéron Georges
Thanks a lot for the fixes, Matthew! The workaround was not too much of a problem to set up in the end (the elemref were generated by a macro in my case, so I just had to use make-link-element + the global variable instead of elemref). I'll probably get rid of it once a new version with your fi

[racket-users] Re: Properly annotating disappeared uses/bindings for substituted identifiers

2016-10-12 Thread Dupéron Georges
My experience with check-syntax is that several conditions have to be met: * The identifiers must have the correct source locations (actually, you can make arrows point to weird places by faking the source locations) * The properties must be present high enough in the AST. For example, if you pu

[racket-users] Re: FUSE filesystem package

2016-10-12 Thread Dupéron Georges
This is great! Thumbs up, and thanks for writing this library. I have a couple of filesystems in my "TODO" list, hopefully this package will motivate me to actually write them one of these days :) . A nice feature would be some simpler API for creating filesystems which work by virtually moving

[racket-users] Re: Planet package murphy/protobuf for Protocol Buffers

2016-10-14 Thread Dupéron Georges
Maybe it's in /Users/dstorrs/Library/Racket/bin, or something like this? otherwise, this command shoul hopefully show the file's path if it is on your system: find / -name protoc-gen-racket -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To u

[racket-users] Re: Redex: macro expanding to a side-condition clause

2016-10-25 Thread Dupéron Georges
Sam, would something like this work for you? I'm using the generic-syntax-expanders library to easily define expanders (sorts of macros) which are expanded within uses of a wrapper of define-judgment-form. #lang racket (require (rename-in redex [define-judgment-form orig:

[racket-users] Re: Redex: macro expanding to a side-condition clause

2016-10-26 Thread Dupéron Georges
Be aware that `expand-all-judgment-form-expanders` does what it says on the tin: if the `(define-judgment-form …)` contains something that should in principle shadow the expander, e.g. something equivalent to `(let ([where/not (λ (x) 42)]) (where/not 'blah))`, then the `expand-all-judgment-form-

Re: [racket-users] degenerate performance in syntax-parse

2016-10-26 Thread Dupéron Georges
> The only issue is converting our mountain of code that uses the old syntax > (more than 40,000 lines, if you can believe it). I would suggest keeping the old syntax too via {~or #:blend {~and blend-stx blend}}, but making it log a warning when (attribute blend-stx) is true, printing (syntax-s

[racket-users] Re: Reducing Program Startup Time

2016-12-03 Thread Dupéron Georges
A few ideas: 1) Loading a lot of modules can be slow. You are already avoiding that by using racket/base and racket/gui/base, so that's good, but it already takes me 0.5s just to require these :-( . I don't know it there is much to do about this. 2) Your main.rkt might be doing a some lengthy in

[racket-users] Language-provided bindings and arrows in DrRacket

2016-12-03 Thread Dupéron Georges
I'm writing a meta-language (a small extension of scribble/lp2), which delegates to a second language. I am using the neat trick suggested to me by Alex Knauth [1], but I have trouble getting the arrows to be drawn in DrRacket for language "built-ins". A boiled down version of the language file

[racket-users] Re: Language-provided bindings and arrows in DrRacket

2016-12-03 Thread Dupéron Georges
I made a copy-paste mistake, the replacement for the last line of "MyLang.rkt" should use "body2" instead of "body": #'(#%plain-module-begin (module nm lng (#%plain-module-begin . body2))) -- You received this message because you are subscribed to the Google Groups "Racket Users" group

Re: [racket-users] Re: Language-provided bindings and arrows in DrRacket

2016-12-04 Thread Dupéron Georges
Le dimanche 4 décembre 2016 04:18:44 UTC+1, Robby Findler a écrit : > The fully expanded form of the original program doesn't have a require > that brings in displayln? Indeed, if I use (#%require lng) the arrows get drawn. However, the body can require libraries which shadow some of the languag

Re: [racket-users] Re: Language-provided bindings and arrows in DrRacket

2016-12-04 Thread Dupéron Georges
I think I found a solution which allows me to inject the (#%require lng) without causing conflicts with other required module: applying an extra scope to the whole body makes the other (require) forms more specific, and they can shadow bindings imported by (#%require lng). Here is the modified

[racket-users] Extracting the body of a fully-expanded module (with submodules)

2016-12-14 Thread Dupéron Georges
Hello! This is a follow-up to the excellent answer by Alex Knauth on StackOverflow here: http://stackoverflow.com/a/38032107/324969 and this mailing-list thread: https://groups.google.com/forum/#!topic/racket-users/sS-pUUGp9o4 I'm trying to write a module meta-language mylang, which accepts a s

Re: [racket-users] Extracting the body of a fully-expanded module (with submodules)

2016-12-15 Thread Dupéron Georges
Thanks Matthew! Your solution seems to work fine, the trampoline idea is a very neat trick. I like how it's safe to use require and begin because the continue macro returns fully-expanded syntax which won't be affected by the code injected around (for some reason I thought it was necessary to o

Re: [racket-users] syntax-property lost across module boundary (WAS: format-id doesn't preserve preserved?-edness of syntax-property?)

2016-12-15 Thread Dupéron Georges
Le jeudi 15 décembre 2016 00:48:13 UTC+1, Alexis King a écrit : > without much issue, modulo an issue I asked about on this mailing > list a month or two back Here's (what I suspect is) the thread Alexis mentions, for those who feel curious: https://groups.google.com/forum/#!topic/racket-users/TG

[racket-users] Issue with the catalog (package removed and re-added does not appear)

2016-12-16 Thread Dupéron Georges
Hi all! I tried adding a "version exception" earlier, which partially failed (rendering that package unusable on version in question, with the error "cannot use empty checksum for Git repostory package source"). As a last ressort, I tried removing the package and re-adding it, but now although

[racket-users] Re: Issue with the catalog (package removed and re-added does not appear)

2016-12-18 Thread Dupéron Georges
Actually, it seems I simply can't add any new package (neither pkgn.racket-lang.org nor from pkgs.racket-lang.org). -- 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] mirror.racket-lang.org seems down, and, 301 or 302?

2016-12-27 Thread Dupéron Georges
Greg, maybe you could push a commit to travis-racket, changing the URL to the currently-working one, and revert that after the maintenance? That way the repos which fetch travis-racket on the fly would still build while mirror.racket-lang.org is down. -- You received this message because you a

[racket-users] Re: New website design feedback

2016-12-27 Thread Dupéron Georges
One small point: I think it was good in the old site to have a link to the documentation right at the top, where now there are just "Packages" and "Download". We have great documentation (with a great design, thanks to Matthew!), better put it forward :) > 2. Greyed out code snippets - I am not

Re: [racket-users] Mobile Friendly HTML in Scribble?

2016-12-28 Thread Dupéron Georges
Le mercredi 28 décembre 2016 07:00:24 UTC+1, Matthew Butterick a écrit : > If someone knows offhand where the main Scribble HTML template lives in > `racket/scribble`, that would save me some time discovering it. https://github.com/racket/scribble/blob/master/scribble-lib/scribble/html-render.rkt

[racket-users] Re: Fix Ctr+F search on the new website?

2016-12-29 Thread Dupéron Georges
Good catch! I looked this up a bit, unfortunately it seems that there is no reliable way to detect when the browser's search feature is started, let alone know where the results are and which one is currently highlighted. None of the options available is entirely satisfactory: * Use JavaScript

[racket-users] [ANN] Tools for debugging scope problems (for unhygienic macros)

2017-01-03 Thread Dupéron Georges
Hi all! TL;DR: if you're struggling when debugging scopes, I wrote a couple of utilities to help: (+scopes stx) shows the scopes in a readable manner, (print-full-scopes) gives a summary of these scopes, and (make-named-scope string-or-symbol) creates a fresh scope annotat

Re: [racket-users] hello, where can I find the distribution 6.7.0.3.

2017-01-04 Thread Dupéron Georges
I don't think the old "minor" versions are kept, only the last few as Stephen pointed out. As can be checked in the git log for https://github.com/racket/racket/blame/master/pkgs/base/info.rkt, the version number was bumped away from 6.7.0.3 in commit d7b18e7, so you could try checking out the

[racket-users] Re: parameterize during compile

2017-01-20 Thread Dupéron Georges
Hi Dan, Try with this: main.rkt: #lang racket (require racket/stxparam "macro.rkt" "param.rkt") (syntax-parameterize ([dirs 123]) (mymacro)) macro.rkt: #lang racket (require racket/stxparam "param.rkt") (provide mymacro) (define-syntax (mymacro stx) #`(printf "dirs was ~a\n" #,(syntax-para

Re: [racket-users] How to watch the filesystem

2017-01-20 Thread Dupéron Georges
Le vendredi 20 janvier 2017 19:47:11 UTC+1, David K. Storrs a écrit : > I see that I can get the event telling me that something changed. As > far as I can tell the event contains no information about *what* > changed, it simply alerts that *something* changed. Likewise, the > monitor is only for

[racket-users] Re: Dynamic-require a compile-time identifier?

2017-01-21 Thread Dupéron Georges
I was going to suggest `dynamic-require-for-syntax`, but it seems to do exactly the same thing as `dynamic-require`, i.e. give the value of a phase-0 provided identifier. Is this normal? The `eval` trick is a good idea, I would say. From the couple of times I have used dynamic-require, I have f

Re: [racket-users] Package layout in docs

2017-01-30 Thread Dupéron Georges
Le lundi 30 janvier 2017 22:13:57 UTC+1, Matthew Butterick a écrit : > Recently we added a Racket logo to the upper right of the public doc pages. > We could do something where this logo changed depending on whether the > package belonged to core or community or whatever. Then we wouldn't need to

Re: [racket-users] Confused about syntax properties

2017-02-02 Thread Dupéron Georges
Le lundi 30 janvier 2017 06:25:29 UTC+1, Matias Eyzaguirre a écrit : > Nice, thanks! I wasn’t aware of that. so macros are expanded in the order > that the reader reads them, not in so called evaluation order. >From experience, the order is outside-in, each form after the preceding one >(except

Re: [racket-users] Confused about syntax properties

2017-02-02 Thread Dupéron Georges
PS: a nice example to try in the macro stepper, to see the evaluation order: #lang racket (define-syntax (foo stx) #'1) (define-syntax (bar stx) #'foo) (let () bar (let () bar (let () bar bar) (#%expression bar) bar) (+ bar bar) bar) -- You received this mess

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Dupéron Georges
Le vendredi 3 février 2017 10:56:10 UTC+1, Laurent Orseau a écrit : > Btw, with "Macro Hiding: Disabled" we can see that after foo is turned into > #'1 (printed '1' in the macro stepper), then the 1 is 'tagged' with (#%datum > . 1) and then right after that turned into (quote 1). Is the tagging s

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Dupéron Georges
Le vendredi 3 février 2017 11:28:47 UTC+1, Laurent Orseau a écrit : > I see. So basically all #% things are extension points? > The list for the racket language: > > http://docs.racket-lang.org/search/index.html?q=%23%25%20L%3Aracket  I think #% just means "low-level". * #%declare, #%expression,

[racket-users] packages with separate -lib -test and -doc [Was: Package layout in docs]

2017-02-03 Thread Dupéron Georges
Hi Neil, I'm starting a new thread to avoid hijacking the "Package layout in docs" thread. Le mardi 31 janvier 2017 20:25:31 UTC+1, Neil Van Dyke a écrit : > Greg Trzeciak wrote on 01/31/2017 01:24 PM: > > Speaking of packages - there seems to be a trend recently in racket > > packages to creat

Re: [racket-users] syntax-parse: using expr/c with ~optional

2017-03-22 Thread Dupéron Georges
> (prefix 6 5 4) raises the same error as before, and the definition of > prefix/parse complains "syntax-parse: duplicate attribute in: tail". This is because ~or behaves differently under ellipses, and nested ~or are just inlined. Your code for prefix/parse is therefore equivalent to (~or alt1

[racket-users] Re: empty lines in a grammer of defform of scribble

2017-03-28 Thread Dupéron Georges
Le lundi 27 mars 2017 22:36:43 UTC+2, jos.koot a écrit : > When I use #:grammar in a defform, > the rules of the grammer are separated by empty lines. > > I would like to avoid these empty lines. > Is it possible? I haven't seen a built-in mechanism to control this. Generally speaking, the tools

[racket-users] Re: How to work on a package from a released version of Racket?

2017-04-09 Thread Dupéron Georges
I hope that there's a better way, however what I ended up doing was this: 1) Install a "Minimal Racket" from http://download.racket-lang.org/releases/6.8/ (scroll down a bit to see these versions). 2) cd path/to/my-clone-of-plot/; raco pkg install 3) raco pkg install main-distribution If you

[racket-users] Re: Algol

2017-04-09 Thread Dupéron Georges
As you say, it works with "#lang algol60", but I can't find "Algol60" in the language selection dialog on DrRacket 6.9.0.1, only R5RS, "Pretty big Scheme" and "ProfessorJ" (which I installed manually). Which version are you using? Which version were you using when it used to work?This may help

Re: [racket-users] Re: How to work on a package from a released version of Racket?

2017-04-09 Thread Dupéron Georges
I thought raco pkg update was unable to turn a catalog-package into a locally-installed package, but I might have tried it at the time within the directory itself, instead of cd-ing one level up like you said. Thanks for the tip! -- You received this message because you are subscribed to the Goo

[racket-users] How to improve compile times?

2017-04-26 Thread Dupéron Georges
Hi all! Some of my libraries take a while to load: just adding a (require mylib) to an empty #lang racket/base file bumps the compile time from 0.5s to 1.5s, even if no bindings from the library are used. After experimenting a bit, it seems that the overhead is mainly due to other modules which

[racket-users] Re: #:grammar and #:contracts of scribble

2017-04-26 Thread Dupéron Georges
Hi, This sounds like a nice enhancement. You might want to request this at https://github.com/racket/scribble/issues . Aside from the implementation difficulty (the code for defform and friends is large, handles many edge cases, and feels a bit like spaghetti code), one of the main concerns wo

Re: [racket-users] How to improve compile times?

2017-04-27 Thread Dupéron Georges
Thank you Matthew for the explanation. If I understand correctly, * Alex Harsanyi's start-up time is due to run-time (phase 0) initialisation code in the required libraries, including things like (define v costly-expression), which look like they could be saved as constants, but actually invol

Re: [racket-users] How to improve compile times?

2017-04-28 Thread Dupéron Georges
> > * Alex Harsanyi's start-up time is due to run-time (phase 0) initialisation > > code in the required libraries, including things like (define v > > costly-expression), which look like they could be saved as constants, but > > actually involve running the expression. > > I actively try to av

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-04 Thread Dupéron Georges
Le jeudi 4 mai 2017 03:00:10 UTC+2, Daniel Prager a écrit : > On the subject of turning down contracts for performance and then being > bitten, believe me, I hear you: my preference is to have the maximum checking > I can afford. But when I'm really writing stringent post-conditions (or > invari

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-04 Thread Dupéron Georges
Le vendredi 5 mai 2017 02:30:50 UTC+2, Ben Greenman a écrit : > With a `define/contract-out` macro? > > But I'd rather not have a macro like this in the contract library. > I prefer reading code with all the "provide" statements at the top of the > file. Since provide transformers are executed i

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-05 Thread Dupéron Georges
Le vendredi 5 mai 2017 15:24:40 UTC+2, Matthias Felleisen a écrit : > See > https://docs.racket-lang.org/style/Units_of_Code.html#%28part._.Modules_and_their_.Interfaces%29 That's a very interesting document, thanks for the reference. Would you suggest that, in this spirit, types for functions a

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-05 Thread Dupéron Georges
Le vendredi 5 mai 2017 16:36:49 UTC+2, Matthias Felleisen a écrit : > I think that developers should write contracts and use them during testing > and deployment in the same way. I did this decades ago for embedded realtime > software and we’d be all better off if we did so. I agree that I alwa

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-05 Thread Dupéron Georges
Le vendredi 5 mai 2017 19:10:12 UTC+2, Matthias Felleisen a écrit : > > 1. (define/contract (foo input) (-> blah (listof integer?)) …) > > > > This has a O(n²) cost. > > I assume input is also a list. Then Racket’s define/contract is NOT O(n²) > because the recursion of foo is considered INSIDE

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-06 Thread Dupéron Georges
Le samedi 6 mai 2017 23:38:29 UTC+2, Daniel Prager a écrit : > Although I understand why my macro does this > > unsafe-factorial: contract violation > ... > blaming: (function fn/impl) > ... > at: unsaved-editor:13.15 > > > Ideally I would prefer one which blames unsafe-factorial > > unsafe-fac

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-06 Thread Dupéron Georges
Le dimanche 7 mai 2017 00:27:36 UTC+2, Daniel Prager a écrit : > Thanks Georges > > It looks suggestive, but I'm struggling to follow the details of > with-contract / blame-id. An example of use would be very helpful in the docs! This gives "blaming: (region unsafe-factorial)" instead of "blamin

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-07 Thread Dupéron Georges
Le dimanche 7 mai 2017 07:27:08 UTC+2, Daniel Prager a écrit : > 1. Default argument goes missing from post-condition, leading to an > unexpected error ... You should use unsupplied-arg? . But I couldn't find a way to get the default value from the contract. I would guess that the problem is that

Re: [racket-users] Apropos contracts: simple predicates and switching on and off

2017-05-07 Thread Dupéron Georges
Le dimanche 7 mai 2017 23:14:17 UTC+2, Daniel Prager a écrit : > Thanks for the explanation on 2. Pragmatically, it's just another contributor > to the cost of contract checking. I suppose you meant point 3, instead of point 2? The thread I linked to indicates that with ->d, the double-checking

[racket-users] Scribble: is there a way to refer to a section by its number in HTML?

2017-06-08 Thread Dupéron Georges
Generally it is nice to get the actual section title printed when using @secref["mysection"]. However, in some cases it is a bit awkwards: Chapter State of the art presents related work. Chapter Implementation explains in detail how this library is implemented. etc. I'd rather have something as

Re: [racket-users] Indentation of for-clauses

2017-06-15 Thread Dupéron Georges
Le mardi 13 juin 2017 23:49:23 UTC+2, Alex Knauth a écrit : > I'm imagining the existing DrRacket indentation rules would be expressed as: > > […] This seems like a nice concise notation, although it is a bit cryptic at first sight :) . I'm not quite sure if if covers the following case (where

Re: [racket-users] Scribble: is there a way to refer to a section by its number in HTML?

2017-06-22 Thread Dupéron Georges
Thanks a lot! I was able to build an @sec-number-ref function. Here it is below. Matthew, since this is not a copy-paste of your code, I hope you won't see any problems if I place this in the public domain / CC0 license? @(define (sec-number→string tag #:doc [doc #f]) (delayed-element (λ

Re: [racket-users] Scribble: is there a way to refer to a section by its number in HTML?

2017-06-22 Thread Dupéron Georges
My apologies, the code I just posted was missing a `reverse`. Here's the fixed version: @(define (sec-number→string tag #:doc [doc #f]) (delayed-element (λ (the-renderer the-part the-resolve-info) (define sec-tag (make-section-tag tag #:doc doc)) (define resolved-sec-tag (resol

Re: [racket-users] Scribble: tables and figures with captions and numbering?

2017-07-07 Thread Dupéron Georges
Scribble has a low-level mechanisms for handling “numberers”, which aim to solve the the same problem as LaTeX's counters. http://docs.racket-lang.org/scribble/core.html#%28tech._numberer%29 Alternatively, MathJax natively supports numbering equations: http://docs.mathjax.org/en/latest/tex.html