> On Oct 30, 2017, at 9:43 AM, Masto Fine <thomaspierrard1...@gmail.com> wrote:
> bonjour , pouvez vous m'expliquer concretement comment utiliser require et 
> provide , et comment extraire seulement une partie d'un teachpack.

Good style proposes to use provide like this: 

#lang racket  ;; ‘server’ module 

  ;; Number -> Number 
  ;; the identify function on numbers 

  ;; Number -> Zero 
  ;; the 0 function on numbers 

;; - - - 
;; implementation 

(define (identity x)  (local-identity x))
(define (zero x)   0)

;; Number -> Number 
;; does some random stuff 
(define *return #f)
(define (local-identity x)
  (call/cc (lambda (return) (set! *return return) (*return (+ (- x 1) 1)))))

#lang racket ;; client 1
(require “server.rkt”)
;; now you see both identify and zero 

#lang racket ;; client 2 
(require (only-in “server.rkt” zero))
;; now you see only zero 


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.

Reply via email to