[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Goo Nitpicks



Jonathan Hseu <vomjom@vomjom.org> writes:

> Resending this e-mail because majordomo had problems:
> 
> Most important is #1:
> 1. Many programmers prefer mod:name over (use)ing everything into the
> namespace.  
> The problem with mod:name as it is is that directories can pile up:
> (foo/bar/baz/math:sin foo/bar/baz/math:$pi)
> 
> Even a simple goo/math:$pi is a pain to type.
> 
> My proposal is this:
> If the programmer types: (use goo/math)  , it imports everything as it
>   does now.
> If the programmer types: (use goo/math math)  , the second argument
>   becomes the shortened version and then the programmer can type
>   math:$pi

that seems reasonable.  there are other deficiencies of the current
minimal module system such as no renaming, no set operations (i.e.,
selective importation), absolutely no circularities.  

> This would replace the current mod:name system (because of possible
> name clashing).

how would this replace it and what name clashes are you referring to?

> 2. Why not replace swapf with Common Lisp's rotatef, which is
> generally more useful?

just trying to keep things simple, but i see your point.

> 3. Chris Armstrong's nitpick: Why is string formatting tied to ports?

for efficiency.

> It'd be nice if there was a function ('format' maybe?) that returned
> a formatted string the way (msg) prints them.

  (df format (str|<str> args|... => <str>)
    (port2str port (app msg port str args)))

> (msg) could still exist as a shortened version of (write port (format))

but then you're going cons a string unless you have a much smarter
compiler.

there definitely needs more work on printing.  i'll think more about
this.

> 4. We need a slicing function for sequences (I couldn't find one...).
> 'slice' is a good name IMHO... we could possibly use _ to indicate
> either the end or beginning of the array.  For instance:
> (slice array 1 _) to slice from 1 -> end.  (Or use Python's -1?)

it's called 'sub'.  i do like the python's -1 but that does
potentially mask real indexing errors.  it's probably worth the
convenience though.

> Also, an optional third argument for step size would be nice.

sure.

> 5. Two things are incorrect on the web:
> Example for DS should use 'unless' and not 'when'

yep.

> (empty) has an incorrect signature

yep.

> 6. Why is DS like: (ds (macro ,blah ,@asdf)) and not like:
> (ds macro (,blah ,@asdf))?
> 
> It seems inconsistent with DF and DM.

i see your point.  i was trying to make it somewhat wysiwyg but then i
could have done the same with DF's looking more like calls (as is done
in scheme with define).

> 7. *-setter seems too long.  *! or *-set or *-set! may be better names.

reasonable.

> 8. Some destructive functions don't have a !, such as set.

having set not have a ! was intentional.  wanted it to be short.

what other functions do you have in mind?

> 9. Bugs: dv always returns #f.  push is broken for lists.
> 
> 10. Will we be able to import from the directory in which goo is run in
> the future?
> 
> 11. According to wiki, default values will look like:
> (dm function (a:0|<int> b:1|<int>))
> 
> It may be just me, but I think default values should be consistent with
> rep's and let's variable assignments.
> 
> So, maybe make default values look like:
> (dm function ((a 0)|<int> (b 0)|<int>))
> 
> Or change let/rep to look like:
> (let (x:0 y:3))

nice.

> 12. Functions like (trunc/) should IMO return one value.  If the
> programmer wanted a remainder, they would use (mod)

that's probably a reasonable suggestion.  

> It could still return one value, but be able to assign two much like
> Common Lisp's multiple-value-bind.

but that's another thing altogether.  

> That's about it.. so far :)

thanks a bunch for your suggestions and comments.

jonathan

> -- 
> Jonathan Hseu <vomjom@vomjom.org, vomjom@debian.org, jh4@cec.wustl.edu>
> GPG ID:          5228D713
> GPG fingerprint: 220B A4EF 70FE B884 CB38  F93F EA8A 1024 5228 D713