Arc Forumnew | comments | leaders | submit | cooldude127's commentslogin

yes, there are those people who program purely for hobby.

-----

3 points by cooldude127 6314 days ago | link | parent | on: Issues Regarding Lisp Adoption

i like drscheme in general. there is one problem with it that made it simply unusable by me. when you hit run in drscheme to reevaluate your definitions, it obliterates my entire history in the REPL. i need to have that stuff around to retry expressions.

-----

3 points by soegaard 6314 days ago | link

That's by design. [I can dig up a reference, if you are interested]

If you want to retry expressions, stay in the REPL and use ctrl-p (one or more times) to recall previous expressions.

-----

3 points by cooldude127 6318 days ago | link | parent | on: Strangeness with set and macros

I would be more concerned, but there is not really a way to fix this without changing the semantics of set. Set doesn't eval it's first argument, so it expects an unquoted symbol. Get an operator that does the same thing, but evaluates its arguments, and you will be fine.

-----


i agree, this seems like a bug.

-----

1 point by cooldude127 6320 days ago | link | parent | on: Scala style match-case

uniqs aren't really important since these are just functions. if they were macros, that would be another story.

-----


table does make a table out of it's arguments:

  arc> (table 'a 'b 'c 'd)
  #hash((c . d) (a . b))

-----

3 points by almkglor 6320 days ago | link

^^ LOL, I modified that ^^. Didn't want to use (obj ...) because (obj ...) was a macro, and I might want to do things in a function-form.

-----

2 points by kens 6320 days ago | link

Is this the Anarki version? The official version of table takes no arguments.

-----

5 points by cooldude127 6320 days ago | link

yes it is. i didn't realize that table was different in anarki. well, there is always listtab, but seriously, table should work like the anarki version.

-----

1 point by cooldude127 6321 days ago | link | parent | on: Lazy evaluation in Arc

i knew i had seen it done for arc already. it was that article.

-----

1 point by cooldude127 6321 days ago | link | parent | on: Lazy evaluation in Arc

delay and force can be pretty easily written using memoized functions.

or it might be possible to steal scheme's. either way.

-----

2 points by cooldude127 6321 days ago | link | parent | on: ~Tilde and macros

complement only works with functions. behind the scenes, it uses apply to call the original function. at first glance, i don't really see a reason that it couldn't just do the same as (compose no _)

-----

2 points by eds 6321 days ago | link

I know compose works on macros... but I'm not sure you are straight on, because compose uses apply as well. And the macro expansions look exactly the same.

  arc> (macex '(compose no litmatch))
  (fn gs1639 (no (apply litmatch gs1639)))
  arc> (macex '(complement litmatch))
  (fn gs1641 (no (apply litmatch gs1641)))
  arc> ((compose no litmatch) "a" "aston")
  nil
  arc> ((complement litmatch) "a" "aston")
  Error: "vector-ref: expects type <non-negative exact integer> as 2nd argument,
  given: \"a\"; other arguments were: #3(tagged mac #<procedure>)"
So what is going on here?

-----

3 points by cooldude127 6321 days ago | link

except calls to compose are optimized away in the interpreter. they are treated specially. look in the `ac' function in ac.scm. i'm guessing this is the reason.

-----

1 point by absz 6321 days ago | link

Ah! That must be the problem, yes. Good catch!

Now, what to do about the other case... there's still no reason it should bug out, it seems to me. Or rather, it should be implementable in such a way that it shouldn't.

-----

2 points by cooldude127 6321 days ago | link

mainly, we need an apply that works for macros. why would that not be possible, i wonder.

-----

5 points by pg 6321 days ago | link

What you're thinking of can be done, but only by calling eval explicitly. I.e. what you could do thus with or if it were a function:

  (apply or args)
you have to do thus with the real or, which is a macro:

  (eval (cons or args))
This is not surprising, because macros live in the world of expressions, not values.

-----

3 points by aston 6321 days ago | link

What you mean is, we need macros to be first class.

-----

1 point by absz 6321 days ago | link

Yes, we do. But if I recall (and I can't test, because the git "wiki" broke for later mzschemes again), apply does work for macros, except it evaluates all the arguments first, which breaks things like and. Someone should test that, though; as I noted, I can't.

EDIT: No, sorry. It doesn't work. My bad.

-----

4 points by nex3 6321 days ago | link

Just as a note, the wiki is fixed now.

-----

1 point by absz 6321 days ago | link

I saw, that's how I was able to test. Thank you for setting it up, by the way! And if you fixed it, thank you for that; if someone else did, thank them for that.

-----

3 points by nex3 6321 days ago | link

You're welcome :-). It would be wfarr who fixed this issue, though.

-----

1 point by cooldude127 6321 days ago | link

well, yeah. basically.

-----

1 point by absz 6321 days ago | link

Compose does something very similar behind the scenes as well, in fact. So there's no reason it should work either.

-----

2 points by cooldude127 6321 days ago | link | parent | on: Odd behavior with some HTML-work

maybe we could use some doctype macros in html.arc

-----

1 point by wfarr 6321 days ago | link

Additionally, I'd like to see the link macro replaced by something that doesn't... uh, conflict with the <link> tag (which is forcing us to use ugly (pr)s right now instead of (tag)).

-----

1 point by cooldude127 6321 days ago | link

what's wrong with this:

  (attribute link type opstring)
  (attribute link href opstring)
  (attribute link rel  opstring)
  (gentag type "text/css" rel "stylesheet" href "styles.css")

-----

More