[racket-users] big-bang + right click?

2018-02-15 Thread Stephen Foster
Is there a way to differentiate between left and right click with a 
big-bang on-mouse handler?  Or if not, is there some workaround I can use 
to detect right clicks?

-- 
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] Does Racket offer anything for implementing a language with its own GC that could manage GPU memory?

2018-02-15 Thread Gustavo Massaccesi
> Also I forgot to note that I also want my language to have indentation
> sensitive syntax. Would that be doable in Racket?

It's possible (but I never tried it). In the official distribution there
are a few languages implemented in Racket that doesn't look like Racket at
all. For example https://docs.racket-lang.org/algol60/index.html and
https://docs.racket-lang.org/honu/index.html . I also remember a recent
talk by Mathew Flatt about how to implement a non standard language (with
princess and castles ...) but I can't find a link now.

Gustavo


On Sun, Feb 11, 2018 at 2:19 PM, Marko Grdinic  wrote:

> Also I forgot to note that I also want my language to have indentation
> sensitive syntax. Would that be doable in Racket?
>
> --
> 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] Re: Symbolic links and filesystem-change-evt

2018-02-15 Thread George Neuner
On Wed, 14 Feb 2018 16:35:04 -0600, Philip McGrath
 wrote:

>It appears that a `filesystem-change-evt` created with a path referring to
>a symbolic link effectively watches the target of the link for changes, not
>the link itself. For example, deleting the link and creating a new link
>that points to a different target does not cause the event to become ready
>for synchronization. (I've included a demonstration program at the end of
>this email.)
>
>If this is the expected behavior, it seems like it would be worth
>mentioning in the documentation for `filesystem-change-evt`.
>  :


Changing a symlink should cause a change event on the link's parent
directory.  

As to monitoring the link file itself, I'm not sure that can be done.
AFAICT, Windows and Linux both will transfer a file notify request on
the symlink to be on the target instead.

George

-- 
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] More DrRacket binding arrow woes

2018-02-15 Thread Matthias Felleisen

Here is a snippet of code in the language: 

#lang network-flow

;; sample graph

problem: maximize from a to d 

node a -- 10 --> b
node a -- 20 --> c
node b -- 30 --> d
node c -- 30 --> d

Here is a link to the language 

http://www.ccs.neu.edu/home/matthias/4620-s18/network-syn-lang.rkt 


(The github repo for the course is private. Sorry)

— Matthias



> On Feb 15, 2018, at 1:26 AM, Sorawee Porncharoenwase 
>  wrote:
> 
> Thank you for your advice!
> 
> If your code is online and you don't mind, could you point me to the project 
> or any other tutorial so that I can see the sample code? Right now I have 
> https://docs.racket-lang.org/guide/hash-reader.html but the grammar is rather 
> simple. It would be nice if there is a more complex example.
> 
> On Wednesday, February 14, 2018 at 9:32:23 PM UTC-5, Matthias Felleisen wrote:
> 
> Instead of parsing the raw strings, you might consider the following 
> alternative: 
> 
>  — use read tables to nail down identifier syntax and literal constant syntax 
>  — define all keywords and operators and whatever as plain syntax ids that 
> raise a syntax error 
>  — all remaining things are your identifiers  
>  — now use module-begin to turn the sequence of tokens into a tree where each 
> of your identifiers becomes an actual Racket id 
> 
> I just wrote a neat little paren-free language for optmizing network flows 
> this way and it’s a rather viable strategy. 
> 
> 
> 
>> On Feb 14, 2018, at 5:39 AM, Sorawee Porncharoenwase 
>>  wrote:
>> 
>> It works now! I think I simply need a `strip-context` and avoid 
>> `datum->syntax`.
>> 
>> Thank you very much for your help!
>> 
>> On Wednesday, February 14, 2018 at 5:15:06 AM UTC-5, Alexis King wrote:
>> It is worth pointing out that Check Syntax does not see the result of 
>> your reader, it sees the fully-expanded module and performs its analysis 
>> from there. Therefore, it can be useful to use the macro stepper with 
>> macro hiding disabled to inspect the fully-expanded module to make sure 
>> that the information at least appears to be in place. 
>> 
>> In the case of your language, I would use the macro stepper to ensure 
>> the following three things are happening: 
>> 
>>   1. The `sum` identifier appears in binding position in the 
>>  fully-expanded program, and it has the appropriate source location 
>>  information. 
>> 
>>   2. The `sum` identifier also appears in use position in the 
>>  fully-expanded program, and it has distinct source location 
>>  information from the identifier in binding position. 
>> 
>>   3. Both identifiers are syntax-original?. 
>> 
>> If those things are all the case, it’s difficult for me to say much more 
>> without looking at the code itself. 
>> 
>> (As an aside, you should probably be providing the first argument of 
>> my-read-syntax as the first argument to `parse` instead of (object-name 
>> in), but I’m not sure if that’s at all related to the issue here.) 
>> 
>> > On Feb 13, 2018, at 23:33, Sorawee Porncharoenwase 
>> >  wrote: 
>> > 
>> > I have a similar problem but I can't figure out a way to fix it yet 
>> > :( 
>> > 
>> > So, when I hover on `sum` on line 3, I get "no bound occurrences". 
>> > That's definitely false since the program runs fine, and `sum` has a 
>> > bound occurrence below (e.g., line 5). 
>> > 
>> > I print the syntax objects passed into `#%module-begin` in the REPL. 
>> > The srcloc seems right to me. 
>> > 
>> > What baffles me further is that when I follow Robby's suggestion to 
>> > insert a printf inside check-syntax code: 
>> > 
>> > (printf "~a ~a ~a\n" stx-obj (syntax-source stx-obj) (syntax-line 
>> > stx-obj)) 
>> > 
>> > I get the following result (only relevant lines shown) 
>> > 
>> > # #f #f 
>> > # #f #f 
>> > # string 3 
>> > # string 3 
>> > # #f #f 
>> > # string 3 
>> > # #f #f 
>> > # string 5 
>> > # #f #f 
>> > # #f #f 
>> > # string 7 
>> > # string 7 
>> > # string 7 
>> > # #f #f 
>> > # string 7 
>> > ... 
>> > 
>> > So: the sum on line 3 is either missing or somehow becomes `#> > temp1> #f #f` 
>> > 
>> > And sum on line 7 has a correct srcloc, except that the syntax-source 
>> > somehow changes from `'unsaved-editor` to `string`?!? 
>> > 
>> > FYI, I use megaparsack's `parse-syntax-string` like this: 
>> > 
>> > (define (parse src in) 
>> >   (define len (string-length "#lang recursive-language")) 
>> >   (parse-result! 
>> >(parse-syntax-string toplevel/p 
>> > (datum->syntax #f (port->string in) 
>> >(list src 1 len (add1 len) 0 
>> > 
>> > And this is my module reader 
>> > 
>> > (module reader racket 
>> >   (require syntax/strip-context) 
>> >   (require "parser.rkt") 
>> >   (provide (rename-out [my-read-syntax read-syntax] 
>> >[my-read