Re: G-exps: thunk instead of top-level references?

2024-03-10 Thread Josselin Poiret
Hi Hartmut,

Hartmut Goebel  writes:

> Hi Ludio,
>
> I'd like to get some advice:
>
> In commit 84c3aafb5a18ad278bbb36df7b70849fe05789c8 "trytond: Avoid top-level 
> references to other modules"
> your turned a top-level variable which defines into a thunk:
>
> 
>
>  -(define %standard-trytond-native-inputs
>  +(define (%standard-trytond-native-inputs)
> `(("python-dateutil" ,python-dateutil)
>
> and the users:
>
>   (native-inputs
>  - `(,@%standard-trytond-native-inputs
>  + `(,@(%standard-trytond-native-inputs)
>  ("trytond-purchase" ,trytond-purchase)))
>
> I'm about to change the uses into G-exprs (see below) and wonder whether 
> "%standard-trytond-native-inputs"
> should still be a thunk or can be turned pack into a top-level variable.
>
>  -(define (%standard-trytond-native-inputs) 
>  -  `(("python-dateutil" ,python-dateutil) 
>  +(define %standard-trytond-native-inputs 
>  +  (list python-dateutil
>
> and uses
>
>  -(native-inputs (%standard-trytond-native-inputs))
>  +(native-inputs
>  + (cons* trytond-account-payment-clearing
>  +%standard-trytond-native-inputs))
>   

Yes it still needs to be a thunk for the same reason: no top-level
references to packages in other modules.  By the way, (list ...) is not
a G-exp, it's rather the new input style.

Best,
-- 
Josselin Poiret


signature.asc
Description: PGP signature


G-exps: thunk instead of top-level references?

2024-03-06 Thread Hartmut Goebel

  
  
Hi Ludio,
I'd like to get some advice:

In commit 84c3aafb5a18ad278bbb36df7b70849fe05789c8 "trytond:
  Avoid top-level references to other modules" your turned a
  top-level variable which defines into a thunk:



  -(define %standard-trytond-native-inputs
+(define (%standard-trytond-native-inputs)
   `(("python-dateutil" ,python-dateutil)
  

and the users:

   (native-inputs
- `(,@%standard-trytond-native-inputs
+ `(,@(%standard-trytond-native-inputs)
    ("trytond-purchase" ,trytond-purchase)))
  



I'm about to change the uses into G-exprs (see below) and wonder
  whether "%standard-trytond-native-inputs" should still be a thunk
  or can be turned pack into a top-level variable.

  -(define
(%standard-trytond-native-inputs)
  
  -
 `(("python-dateutil" ,python-dateutil)
  
  +(define
%standard-trytond-native-inputs
  
  +  (list
  python-dateutil
  
  

  and uses


  -    (native-inputs
(%standard-trytond-native-inputs))
+    (native-inputs
+ (cons* trytond-account-payment-clearing
+    %standard-trytond-native-inputs))
 
  

-- 
Regards
Hartmut Goebel

| Hartmut Goebel  | h.goe...@crazy-compilers.com   |
| www.crazy-compilers.com | compilers which you thought are impossible |