Nim implementation of Ruby tap() method

2024-04-24 Thread DMisener
Thanks ... looks like I reversed the working and non working version above...

Nim implementation of Ruby tap() method

2024-04-24 Thread janAkali
That's very easy to fix, use a `block` to avoid clash of identifiers: template tapIt*[T](obj: T, code: untyped): T = block: let it {.inject.} = obj code it var num = 123 echo num.tapIt(echo 2 * it) echo num.tapIt(echo 3 * it)

Nim implementation of Ruby tap() method

2024-04-24 Thread DMisener
## Problem: * A second invocation causes error because of **{.inject.}** INim 0.6.1 Nim Compiler Version 2.0.4 [MacOSX: amd64] at /Users/dennismisener/.nimble/bin/nim nim> template tapIt*[T](obj: T, code: untyped): T = block: let it {.inject.} = obj

Nim implementation of Ruby tap() method

2024-04-24 Thread DMisener
This last one is the winner!! It feels more nim'ish and better still gives me an excuse to use the word _anaphoric_ 🙂 Yes I did overcomplicate it -- I used the **var** since I thought I might want to mutate the input... probably a bad practice anyways. Thanks It always so simple **once you

Nim implementation of Ruby tap() method

2024-04-24 Thread DMisener
Would you mind sharing the source code for **debugs**? I'm curious to see how it was done. Thanks

Nim implementation of Ruby tap() method

2024-04-24 Thread xigoi
Here is also an anaphoric version (to borrow Lisp terminology) if you prefer: template tapIt*[T](obj: T, code: untyped): T = let it {.inject.} = obj code obj var num = 123 echo num.tapIt(echo 2 * it) Run

Can’t wrap my head around this TypeError

2024-04-24 Thread Nlits
I get this type error from my code (the code with the error is above the error): Info: Using the environment variable: NIMBLE_DIR='/home/runner/libmtg/nimble-env' Hint: used config file '/home/runner/.choosenim/toolchains/nim-2.0.4/config/nim.cfg' [Conf] Hint: used config fi

Nim implementation of Ruby tap() method

2024-04-24 Thread juancarlospaco
I use something kinda similar as a macro debugger:

Nim implementation of Ruby tap() method

2024-04-24 Thread xigoi
You overcomplicated it. This works: proc tap*[T](obj: T, code: proc(obj: T)): T = code obj obj let code = proc(i: int) = echo 2*i var num = 123 echo num.tap(code) Run To make it feel more like the Ruby version, you can use an anon

Nim implementation of Ruby tap() method

2024-04-24 Thread DMisener
## I would appreciate a Nim implementation of Ruby's **tap()** method. This is one of those _little helper_ functions I miss from my old Ruby days, where **tap()** : Yields self to the block, and then returns self. The primary purpose of this [method](https://apidock.com/ruby/Object/method) is

What's the best way to match a standard file into a single data structure for editing it?

2024-04-24 Thread giaco
I've been using to (de)serialize binary blobs/protocols it handles endianess and generates data structures blobA > (deserialize) ObjA > proc toObjB > (serialize) ObjB

OEM Keto Gummies : Does It Work Or Not In Your Body?

2024-04-24 Thread salligright
Product Name :- OEM Keto Gummies Main Benefits:- Weight Loss, Official Store And Price Composition:- Natural Organic Compound Side-Effects:- NA Rating:- ⭐ Availability:- Online Where to Buy:- Official Website – {Buy Now Here — Click Here} OEM Keto Gummies:- have been clinically proven an

Vitality Labs CBD Gummies : Nature's Treasure Trove

2024-04-24 Thread JuanitaDMyers
Vitality Labs CBD Gummies : Nature's Treasure Trove Vitality Labs CBD Gummies is known to be a trademark and reasonable creation of various typical trimmings that we require bringing the improvement or when we want to help sexual energy or need to have extraordinary sex with the associate. Offic

Vitality Labs CBD Gummies : Precautions You Should Know

2024-04-24 Thread JuanitaDMyers
Vitality Labs CBD Gummies : Precautions You Should Know Vitality Labs CBD Gummies one of the most surprising selling male enhancement supplements whenever conveyed. Official Website Of USA Residents ➲➲ Click Here The affiliation moreover claims to have composed an introduction on Vitality labs

Nim 2.0.4 and 1.6.20 released

2024-04-24 Thread Hobbyman
Congratulations and thanks for the new release!

Resources for Learning Nim

2024-04-24 Thread timelems
@dwhall256, PR on the repo link would be preferred.

Nim 2.0.4 and 1.6.20 released

2024-04-24 Thread Hobbyman
I still have to dive in to nimsuggest at some time...

Resources for Learning Nim

2024-04-24 Thread dwhall256
How would you like to receive suggestions? PR on the repo link you provided? Message on this thread?

Resources for Learning Nim

2024-04-24 Thread timelems
I'm trying to aggregate a list of resources for learning to program, using Nim! It's open and contributions are welcome and expected! PS. Rabutu, and all names in this organization, are from the Akkadian language. Akkadian is one of the likely Sumerian language

What Are The Ingredients of Erectonol?

2024-04-24 Thread sumantrapillu
There are different huge strengths a part of this supplementation. Most of the key overwhelming materials integrate things like: Tribulus Terrestris - This is the vegetation which has berries with healthy qualities. Erectonol could uphold proportions of male improvement chemicals inside your bod

Benefits Of The Genius Wave Reviews

2024-04-24 Thread TheGenius
➲Product Review: —>The Genius Wave ➲Used For: —>Theta-based sound frequency developed to alter our gene expression and fix the shrunken hippocampus effect ➲Composition: —>Natural Organic Compound ➲Category —> Health ➲Results -In 1-2 Months ➲Side-Effects: —>No Major Side Effects ➲Rating: —>5.0/5.

Top OEM Keto Gummies Brands to Try in the UK

2024-04-24 Thread agnesocohn
OEM Keto Gummies UK :- In addition to its anti-inflammatory qualities, ketones may promote brain health, enhancing mental clarity and cognitive performance.Strict devotion to a low-carb, moderate-protein, high-fat diet is usually necessary to enter and stay in ketosis. Official website@OEM Keto

Sumatra Slim Belly Tonic: Ingredients, Benefits, and Price

2024-04-24 Thread sumantrapill
If you're searching for a sublime and strong procedure for reviving your Fat diet, then, vehicle favor Fat Sumatra Slim Belly Tonic sweets are a remarkable decision! These contain phenomenal plans that assist you with getting slimmer while in this way assisting you with staying mindful of your s