It's not unthinkable but I'm not a fan of the idea either.
Hi, I'm learning nim and decided to translate some FizzBuzz code from Basic
that uses Case(switch) vs If Else If.
Here's the Basic syntax:
i = 1 to 100
select case
case i mod 15 = 0
print "FizzBuzz"
case i mod 3 = 0
pr
Thank you. I was trying to see if `{.importc, inheritable, pure.}` can directly
map the class hierarchy of gobject to nim, it will look simple and natural. Now
I am trying to use concept + template write binding
I am playing with gobject/gtk.
Thanks, @ElegantBeef! I was able to fix my issue. I used a while instead of a
for and that seemed to work.
Araq>Shouldn't this be ...
Proc first[T](list: SomeLinkedList[T]): SomeLinkedNode[T] =
result = list.head
Run
Probaby... but I really didn't want the now extraneous _next_ from the
_source_. My implementation is less than ideal since it always allocates a new
no
I disagree that linked lists are obsolete; they are fundamental to the history
of computer science, are still widely used (e.g. the linux kernel is full of
them), and are still useful in some niches (e.g. mutating a container while
iterating over it)
car/cdr however, were assembly instructions
Thanks for the quick reply and clarification. I know, changing such fundamental
things is not possible because of existing code, and being so used to it
probably make it seem a non-issue.
OTOH, having inconsistencies in fundamental places confuse new users which are
trying to learn Nim and "get
You're correct, `newSeq` should have been `initSeq` according to our own rules
but `newSeq` predates the rules.
Hi, I just started learning Nim and already like it a lot.
Having read about `ref` types and the proc [naming
convention](https://nim-lang.org/docs/nep1.html), I wonder if `newSeq()` is
named inconistently, maybe because of historic reasons, or if I misunderstand
something:
import
Shouldn't this be instead:
proc first[T](list: SomeLinkedList[T]): SomeLinkedNode[T] =
result = list.head
Run
But I don't understand the point of it anyway. Linked lists are a mostly
obsolete data structure and not particularly convenient to work with either.
You don't need to quote anything with a ` in a template
12 matches
Mail list logo