Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
WOW. I finish read the doc about #:final That is so beatiful thing. Thank you to you three Em dom, 17 de fev de 2019 às 22:18, Joao Pedro Abreu De Souza < jp_ab...@id.uff.br> escreveu: > Thanks for the feedback! > I will study this code and make more functional > > Em dom,

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
with each other or itself. You could likewise parameterize the > exit handler around your call to define-main for testing purposes. > > However, I think this is a good example of why side-effects (like exiting) > are less good for testing than returning values. > > -Philip > > &

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
Thanks a lot. Sorry about the simple error. Em dom, 17 de fev de 2019 22:06, Matthias Felleisen > > On Feb 17, 2019, at 6:44 PM, Joao Pedro Abreu De Souza > wrote: > > (check-equal? > (with-output-to-string >(lambda () > (with-input-from-string

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
t return a struct "execute" in the case of reading a "exit 0" just call (exit 0) Em dom, 17 de fev de 2019 às 16:07, Joao Pedro Abreu De Souza < jp_ab...@id.uff.br> escreveu: > Well, there's no imediate return, i need to type exit 0 to finally the > test work

Re: [racket-users] test user-interact function dont work

2019-02-17 Thread Joao Pedro Abreu De Souza
gt;(lambda () > (with-input-from-string "input" >(lambda () > (refine-main) > "input") > > On Sun, Feb 17, 2019 at 12:35 AM Joao Pedro Abreu De Souza > wrote: > > > > Hi everyone. I have a test of a user-related f

[racket-users] test user-interact function dont work

2019-02-16 Thread Joao Pedro Abreu De Souza
Hi everyone. I have a test of a user-related function that I don't can see why don't work : #lang racket (require rackunit) (require "../../main.rkt") (check-equal? (with-output-to-string (lambda () (with-input-from-string

Re: [racket-users] Functions in a terminal port

2019-01-03 Thread Joao Pedro Abreu De Souza
, Joao Pedro Abreu De Souza < jp_ab...@id.uff.br> escreveu: > Thanks, Neil. I will test today later. :) > > Em qui, 3 de jan de 2019 04:35, Neil Van Dyke escreveu: > >> If you're on a Unix, like GNU/Linux or a BSD, you could use the >> `charterm` package: >>

Re: [racket-users] Functions in a terminal port

2019-01-03 Thread Joao Pedro Abreu De Souza
Thanks, Neil. I will test today later. :) Em qui, 3 de jan de 2019 04:35, Neil Van Dyke If you're on a Unix, like GNU/Linux or a BSD, you could use the > `charterm` package: > > #lang racket/base > (require charterm) > (with-charterm > (let-values (((w h) (charterm-screen-size))) > (charter

Re: [racket-users] Functions in a terminal port

2019-01-02 Thread Joao Pedro Abreu De Souza
x27;s a better way? Again, thanks a lot for the help until here. Em qui, 3 de jan de 2019 às 04:01, Joao Pedro Abreu De Souza < jp_ab...@id.uff.br> escreveu: > Well, I know that the game will run only on Gnu/Linux systems. A > alternative that I see is using ffi to provide 1 function

Re: [racket-users] Functions in a terminal port

2019-01-02 Thread Joao Pedro Abreu De Souza
Well, I know that the game will run only on Gnu/Linux systems. A alternative that I see is using ffi to provide 1 function that returns this number but if exists some racket-only solution I think is better, right? Em qui, 3 de jan de 2019 às 03:53, Joao Pedro Abreu De Souza < jp_ab...@id.uff

Re: [racket-users] Functions in a terminal port

2019-01-02 Thread Joao Pedro Abreu De Souza
Thanks Ben. The problem is that this functions can give me the number of line that live my next read, but cannot tell me "Well, this port is a terminal and have 80 lines of height". With the height information I can control the display but without that, and using just port-count-lines! and port-n

[racket-users] Functions in a terminal port

2019-01-02 Thread Joao Pedro Abreu De Souza
Hi everyone. I am coding a console-based game in racket to teach shell to freshman on university. In some point, I need to print a message that can have a lot of lines. I want to do a less(the command in the shell)-like output, so the output will freeaze on the end of line, if the user type 'q' the

Re: [racket-users] confusion about call-with-current-continuation

2018-10-25 Thread Joao Pedro Abreu De Souza
> It is a procedure application or special form ? > > > > 2. assume this procedure or special form exists to construct a prompt. > > > > (+ 1 (prompt (* 2 (call/cc (lambda (k) (set! x k) 2) > > > > After the (lambda (k) ...) evaluated, value of k is (*

Re: [racket-users] confusion about call-with-current-continuation

2018-10-25 Thread Joao Pedro Abreu De Souza
compiled, it should be continuation-passing style. > > "lambda" special form also have a sequence of expressions in it. > > They are essentially the same, except the lambda can be applied. > > What is prompt you mentioned? > > I have not heard of this concept before

Re: [racket-users] confusion about call-with-current-continuation

2018-10-25 Thread Joao Pedro Abreu De Souza
Well, call/cc is like (in racket) delimited continuation, and have a implicit prompt around a s-exp, so, as begin is a macro, he don't create a prompt. The continuation captured is (+ 1 []) in your example. If you change the begin to a let, this works, because let expand to a application of a lamb

[racket-users] Get contract from function

2018-08-24 Thread Joao Pedro Abreu De Souza
to handle this special case too. The repository is racket-peg on GitHub, from user rain-1. There's a issue about empty string in the second place I think if this helps. Thank you for the attention. :) 2018-08-24 11:02 GMT-03:00 Alex Knauth : > > > On Aug 24, 2018, at 8:50 AM, Joao

[racket-users] Get contract from function

2018-08-24 Thread Joao Pedro Abreu De Souza
Hi. I am contributing in a library that create functions to parse PEG(parsing expression grammar). To implement a feature, I need to know the return's type of a function. We are using racket, not typed-racket, so I think that I need to get the contract or something like that. I dont see in the refe

Re: [racket-users] FFI | Unions

2016-04-04 Thread Pedro Caldeira
> No. Racket's evaluation model doesn't include the notion of an > allocation stack that is associated with a continuation. > > You could implement some form of stack manually, but heap allocation > (especially as managed by the GC) is usually the way to go. I see, so Racket only stores a referen

Re: [racket-users] FFI | Unions

2016-04-02 Thread Pedro Caldeira
On Friday, 1 April 2016 00:11:30 UTC+2, Matthew Flatt wrote: > At Thu, 31 Mar 2016 15:00:35 -0700 (PDT), Pedro Caldeira wrote: > > Hello everyone, > > > > I am trying to use a set of bindings to SDL2 and I am at loss on how to use > > C > > unions. > >

[racket-users] FFI | Unions

2016-03-31 Thread Pedro Caldeira
Hello everyone, I am trying to use a set of bindings to SDL2 and I am at loss on how to use C unions. If I understood correctly both make-union-type and _union procedures create a new ctype; but how do you actually create instances of these unions? Thank you for your attention. -- You receiv

Re: Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-14 Thread Pedro Caldeira
Does that mean that lambda expressions have an implicit (begin …) block in them? (begin ((displayln 1) (displayln 2) (displayln 3))) leads to an error (begin . ((displayln 1) (displayln 2) (displayln 3))) displays to 1 2 3 Thank you for the detailed explanation I think I get it now. > On 13 Mar

[racket-users] Re: Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Pedro Caldeira
Sorry I've messed up my reply, here's the actual reply >Imagine (_ (foo x y z) (displayln x) (displayln y) (displayln z)) as the >actual syntax. The .body will be bound to the sequence of three diaplaylns and >this sequence will become the body of the lambda in the expansion. So in this case bod

Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Pedro Caldeira
>Imagine (_ (foo x y z) (displayln x) (displayln y) (displayln z)) as the >actual syntax. The .body will be bound to the sequence of three diaplaylns and >this sequence will become the body of the lambda in the expansion. So in this case body will be bound to the list ((displayln x) (displayln y

[racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-13 Thread Pedro Caldeira
Hello everyone, Since I've discovered the concept of metaprogramming I've been quite interested in Racket and its syntax extension capabilities. While searching for a memoization syntax extension I found a macro whose pattern extension remained unclear. (define-syntax define/memoized (syntax

[racket] Mathematics of Program Construction (MPC 2015): final call for papers

2015-01-15 Thread José Pedro Magalhães
University of Oxford, UK (co-chair) Janis Voigtländer Universität Bonn, Germany (co-chair) José Pedro MagalhãesUniversity of Oxford, UK Nicolas Wu University of Oxford, UK For queries about local matters, please write to j...@informatik.uni-bonn.de.

[racket] Scribble - documenting interactions with custom readers

2014-12-03 Thread Pedro Ramos
Using Scribble, how can I use @interaction to document examples in different languages? I have noticed the example for Typed Racket on chapter "4.5 Evaluation and Examples", but is there a way to use @interaction or a similar Scribble function with a language with a custom reader?

Re: [racket] PyonR: A Python Implementation for Racket

2014-11-14 Thread Pedro Ramos
? > > On Fri, Nov 14, 2014 at 6:06 PM, Pedro Ramos < > pedropra...@tecnico.ulisboa.pt> wrote: > >> Hello, >> >> I'm releasing an implementation of the Python language for Racket, which >> I have been developing over the last year as my master thesis in &g

[racket] PyonR: A Python Implementation for Racket

2014-11-14 Thread Pedro Ramos
oint out any missing Python feature, function or method you would like to see implemented. Best regards, Pedro Ramos Racket Users list: http://lists.racket-lang.org/users

[racket] Mathematics of Program Construction (MPC 2015): first call for papers

2014-10-10 Thread José Pedro Magalhães
rsität Bonn, Germany (co-chair) José Pedro MagalhãesUniversity of Oxford, UK Nicolas Wu University of Oxford, UK For queries about local matters, please write to j...@informatik.uni-bonn.de. Racket Users list: http://lists.racket-lang.org/users

[racket] Call for participation: Workshop on Generic Programming

2014-07-12 Thread José Pedro Magalhães
registration: https://regmaster4.com/2014conf/ICFP14/register.php Early registration deadline is 3 August. Program Committee - José Pedro Magalhães (co-chair), University of Oxford Tiark Rompf (co-chair), Oracle Labs & EPFL Peter Achten, Radboud University Nijmegen Nada Amin, E

[racket] Final CFP: Workshop on Generic Programming (WGP) 2014

2014-05-02 Thread José Pedro Magalhães
- José Pedro Magalhães (co-chair), University of Oxford Tiark Rompf (co-chair), Oracle Labs & EPFL Peter Achten, Radboud University Nijmegen Nada Amin, Ecole Polytechnique Fédérale de Lausanne (EPFL) Pierre-Évariste Dagand, INRIA Paris-Rocquencourt Fritz Henglein, University of Copenhagen An

[racket] CFP: Workshop on Generic Programming (WGP) 2014

2014-04-12 Thread José Pedro Magalhães
- José Pedro Magalhães (co-chair), University of Oxford Tiark Rompf (co-chair), Oracle Labs & EPFL Peter Achten, Radboud University Nijmegen Nada Amin, Ecole Polytechnique Fédérale de Lausanne (EPFL) Pierre-Évariste Dagand, INRIA Paris-Rocquencourt Fritz Henglein, University of Copenhagen An

Re: [racket] Need some help for my first real experiment with scheme

2012-04-24 Thread Pedro
ri, Apr 20, 2012 at 4:09 PM, Hendrik Boom wrote: > On Wed, Apr 18, 2012 at 08:54:54PM +0200, Pedro wrote: >> So to put it in a simple way, I need to tokenize all my data and >> create an index which I load into memory...? >> Is this how it is usually done? For example, does

Re: [racket] Need some help for my first real experiment with scheme

2012-04-19 Thread Pedro
So to put it in a simple way, I need to tokenize all my data and create an index which I load into memory...? Is this how it is usually done? For example, does my browser (firefox) keep an index of all the words present in urls and page titles on memory at any given time? On Wed, Apr 18, 2012 at 7

[racket] Need some help for my first real experiment with scheme

2012-04-18 Thread Pedro
Hey all I'm a sucker for note taking applications. I can't get enough of applications like zim or tomboy notes. Both have served me well but, after many years using them, I can't get over some features they're missing that I find important. I decided I would hack my own note taking application. Wh

[racket] How to start embedded racket from a pthread?

2011-08-21 Thread Pedro DeKeratry
EGV MAPERR si_code 1 fault on addr 0x8 Aborted I browsed through the rest of the C API manual looking for hints of what to adjust but nothing jumped out at me. So, what is the secret to get this working? --Pedro _ For list-related administrative tas

Re: [racket] SXML->xexprs ?

2010-07-25 Thread pedro pinto
Thanks, I wrote a very rudimentary function that simply strips @ and &. I am sure its not quite that simple but for the html fragments I am dealing with it seems to be enough. -pp On Sun, Jul 25, 2010 at 5:21 PM, Neil Van Dyke wrote: > Pedro Pinto wrote at 07/25/2010 11:04 AM: >

[racket] SXML->xexprs ?

2010-07-25 Thread Pedro Pinto
Hi there, I am writing a simple web app which involves scrapping html from a web-site and re purposing it. I am using neil/htmlprag to generate sxml and lizorkin/sxml to manipulate it. I would like to mash together the resulting sxml with my own generated xexprs. Is there a recommended way to go

[racket] How to create 'Internal Definitions' in a scheme interpreter.

2010-07-24 Thread Pedro Del Gallego
ine ? ) I am new in this list, so let me know if this question is "off-topic". Thx. -- - Pedro Del Gallego Email              :   pedro.delgall...@gmail.com _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users